qiu_qiskit_encore.statevector
¶
Qiskit statevectors, validated as the states of qubits.
Functions:
-
validated_statevector–Return a copy of the state as a normalized statevector of at least one qubit.
validated_statevector
¶
validated_statevector(state: Statevector | ArrayLike) -> Statevector
Return a copy of the state as a normalized statevector of at least one qubit.
The normalization is checked with Statevector.is_valid, i.e. up to Qiskit's
tolerances Statevector.atol and Statevector.rtol.
Parameters:
-
state(Statevector | ArrayLike) –The state, as a Qiskit statevector or its amplitudes.
Returns:
-
Statevector–The state as a Qiskit statevector.
Raises:
-
ValueError–If the state is not a state of at least one qubit, i.e. its dimension is not a power of 2 larger than 1, or if it is not normalized.
Source code in packages/qiu-qiskit-encore/src/qiu_qiskit_encore/statevector.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | |