quantum_circuit::statevector()← Back to Class quantum_circuit
Get the statevector \(\ket{\psi}\) of the circuit in little endian order
quantum_circuit::statevector()
There are no parameters.
matrix — Returns the matrix representation of statevector \(\ket{\psi}\)
import quantum
qc = quantum_circuit(2)
qc.h(0)
qc.cx(0, 1)
state = qc.statevector()
state.print()
' Output:
' [ 0.707107 + 0i
' 0 + 0i
' 0 + 0i
' 0.707107 + 0i ]