quantum_circuit::density_operator()← Back to Class quantum_circuit
Get density operator of the circuit in little endian order
quantum_circuit::density_operator()
There are no parameters.
matrix — Returns the matrix representation of the density operator
import quantum
qc = quantum_circuit(2)
qc.h(0)
qc.x(1)
rho = qc.density_operator()
rho.print()
' Output:
' [ 0 + 0i 0 + 0i 0 + 0i 0 + 0i
' 0 + 0i 0 + 0i 0 + 0i 0 + 0i
' 0 + 0i 0 + 0i 0.5 + 0i 0.5 + 0i
' 0 + 0i 0 + 0i 0.5 + 0i 0.5 + 0i ]