InitialState

class InitialState[source]

Bases: ABC

Abstract base class for initial quantum state preparation.

Subclasses implement build() to return a QuantumCircuit of size len(wires) that prepares the desired state. Qubit i of the returned circuit corresponds positionally to wires[i] — the wires argument exists purely to let callers communicate domain-level labels (e.g. graph node names) that subclasses may need for length / shape validation.

Attributes Summary

name

Human-readable name of the initial state.

Methods Summary

build(wires)

Return a state-preparation circuit on len(wires) qubits.

Attributes Documentation

name

Human-readable name of the initial state.

Methods Documentation

abstractmethod build(wires)[source]

Return a state-preparation circuit on len(wires) qubits.

Parameters:

wires (Sequence) – Ordered sequence of wire labels (qubit iwires[i]). May contain non-integer labels (e.g. graph node names); only the length and ordering matter for circuit emission.

Return type:

QuantumCircuit

Returns:

A QuantumCircuit with len(wires) qubits.