CustomPerQubitState¶
- class CustomPerQubitState(state_string)[source]¶
Bases:
InitialStatePer-qubit state from a string of
'0','1','+','-'.- Parameters:
state_string (
str) – One character per qubit.'0'→ nothing,'1'→ PauliX,'+'→ Hadamard,'-'→ PauliX then Hadamard.
Methods Summary
build(wires)Return a state-preparation circuit on
len(wires)qubits.Methods Documentation
- build(wires)[source]¶
Return a state-preparation circuit on
len(wires)qubits.- Parameters:
wires (
Sequence) – Ordered sequence of wire labels (qubiti↔wires[i]). May contain non-integer labels (e.g. graph node names); only the length and ordering matter for circuit emission.- Return type:
- Returns:
A
QuantumCircuitwithlen(wires)qubits.