uniqc.algorithms.core.state_preparation.rotation_prepare module¶
Arbitrary complex state preparation lowered to U3 and CNOT.
- uniqc.algorithms.core.state_preparation.rotation_prepare.rotation_prepare(circuit, target_vector, qubits=None)[source]¶
Prepare an arbitrary normalized complex state on
qubits.The target vector is completed to a unitary matrix whose first column is the desired state. Qiskit’s maintained unitary synthesis lowers it to the stable
U3/CNOTbasis, which is then remapped onto the requested physical qubit indices. Qiskit and SciPy are core UnifiedQuantum dependencies, so this path has the same availability as the package.- Parameters:
circuit – Circuit to modify in place.
target_vector – One-dimensional complex amplitude vector of length
2**n. It is normalized automatically.qubits – Distinct target qubit indices.
Noneusesrange(n).
- Raises:
ValueError – The vector is empty, zero, not one-dimensional, not a power-of-two length, or the qubit mapping is invalid.