PauliMeasurementGate fails to construct when given an empty observable

Aperta
#6,136 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@koppolusivanagaraju ci sta già lavorando.

Dal 11/10/2026.

Valutazione

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

Direzione di ricerca

Start by reading the PauliMeasurementGate and DensePauliString entry points, then find and run their existing tests. Check the empty-string cases in the example, including the negated observable. Done when both construct without raising and sampling gives a=0 and b=1.

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

Descrizione

kind/bug-report status/needs-agreed-design triage/accepted

The following should not raise an exception. It should produce a circuit which, when sampled, samples a=0 and b=1.

import cirq
circuit = cirq.Circuit(
    cirq.PauliMeasurementGate(cirq.DensePauliString(""), key="a").on(),
    cirq.PauliMeasurementGate(-cirq.DensePauliString(""), key="b").on(),
)

Failing to measure the empty pauli string is sort of like failing to search for matches to the empty string. It's a corner case but it should still work.

Lingua principale
Python
Stelle
5.1k
Fork
1.3k
Merge medio
1g 12h
PR unite (30g)
48

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/Cirq

Tutte le issue di quantumlib/Cirq

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.