PhaseFitEstimator cannot fit the signal from its own reduced sampling grid

Aperta Adatta ai principianti
#1,479 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

@madcpf ci sta già lavorando.

Dal 4/12/2026.

  • #1482 di @madcpf — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
76/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python

Direzione di ricerca

Inizia da PhaseFitEstimator.get_simulation_points e dal fit dell’ampiezza in openfermion/measurements/vpe_estimators.py; l’issue individua una discrepanza tra la griglia ridotta e la griglia predefinita a quattro punti del fit. Estendi il test esistente di campionamento di Pauli per eseguire il fit sulla griglia a due punti e conferma che restituisca il valore atteso di 0.6 senza un errore di broadcasting.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

For a two-eigenvalue Hamiltonian, PhaseFitEstimator.get_simulation_points(safe=False) returns two times, but the estimator cannot fit a signal measured at those times. Its amplitude fit reconstructs the default four-point grid, so even noiseless measurements fail when applying the reference phase shift.

import numpy as np
from openfermion.measurements.vpe_estimators import PhaseFitEstimator

energies = np.array([-1., 1.])
est = PhaseFitEstimator(energies)
for safe in (True, False):
    t = est.get_simulation_points(safe=safe)
    signal = np.exp(1j * np.outer(t, energies)) @ [0.2, 0.8]
    print(est.get_expectation_value(signal))

At 34adf319 the four-point grid returns 0.6000000000000001, as expected from -1 × 0.2 + 1 × 0.8. The two-point grid raises ValueError: operands could not be broadcast together with shapes (2,) (4,). The two-point system here is full rank. The existing Pauli sampling test already checks that the reduced grid is [0, π/2]; extending coverage through the fit would catch the mismatch. It would be helpful for callers to be able to pass the sampled times (or the same sampling mode) into the fit.

Lingua principale
Python
Stelle
1.7k
Fork
438
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di quantumlib/OpenFermion

Tutte le issue di quantumlib/OpenFermion

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.