Start from any state: `initialize(state)`

Offen
#17 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
54/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
python, rust
Bereich
backend

Rechercherichtung

Start by reading CONTRIBUTING.md and tracing how QuantumCircuit accepts and executes instructions, including its CPU and GPU state paths. Check how state vectors are represented and where state preparation occurs; the issue suggests initialize must be the first instruction. Done means accepting a supplied state, validating its length and normalization, renormalizing it, and covering the requested CPU and GPU behavior.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

enhancement
What you want to do

Begin a circuit from a given state vector (a known ground state, data loaded into amplitudes,
or a state saved from another run) instead of |0…0⟩.

Implementation notes
  • Simplest version: allowed only as the first instruction. It writes the amplitudes directly
    (CPU: copy; GPU: write_buffer) and skips state preparation.
  • Validate the length and normalisation (within 1e-9), and renormalise.
What it could look like
qc = qsengine.QuantumCircuit(3)
qc.initialize(np.array([...], dtype=complex))   # length 2**3, normalised
Contributing
  • I would like to open a pull request for this (see CONTRIBUTING.md).
Vorherrschende Sprache
Rust
Sterne
1
Forks
0
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus kaiwave/qsengine

Alle Issues in kaiwave/qsengine

Ähnliche Issues

Weitere Issues zu Rust

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.