I would like to read the unitary matrix of a quantum circuit in ProjectQ. Is there any way to do it?
1 Answer
$\begingroup$
$\endgroup$
1
Most quantum circuit building softwares, including ProjectQ, do not have any convenience features that explicitly serve this purpose due to the potential overhead of calculating and storing the unitary as the number of qubits increases. The best solution is to create your own function that recovers the unitary. The general idea (software non-specific) is to:
- Create your quantum function
- Iterate through each operation and obtain the matrix representation
- Multiply each unitary to get the final unitary representation of the circuit
-
1$\begingroup$ Thank you for your answer. $\endgroup$ Commented Feb 21, 2021 at 19:44