Impractical to use Partition with CDType (always needs a QAny)

Aperta
#1,799 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
python
Ambito
backend

Direzione di ricerca

Start by reading the Partition implementation and its tests, especially how splitting and merging handle QAny, CAny, and CBit dtypes. Reproduce the reported classical-register behavior and compare the proposed classical_bits argument with a separate method; done means classical splitting and merging have defined, tested behavior without the Cast workaround.

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

Descrizione

area/qdatatype bloqs/bookkeeping

Partition when "splitting" (partition = True) requires an input of dtype: QAny, thus not working when giving it a classical register (such as CUInt).
When "merging" (partition = False), it outputs a QAny(bitsize) even when given CBit (which should at least raise an error).

It is still possible to use Partition in these cases using Cast, but it messes up qubit count and feels like an unnecessary work around.

Possible solutions would be to add a classical_bits: bool = False argument to Partition which would use a dtype: CAny instead of QAny.
Another possibility is a new Partition method for Classical bits.

Lingua principale
Python
Stelle
397
Fork
127
Merge medio
2g 19h
PR unite (30g)
4

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

Tutte le issue di quantumlib/Qualtran

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.