5
$\begingroup$

I would like to read the unitary matrix of a quantum circuit in ProjectQ. Is there any way to do it?

$\endgroup$
1
  • 2
    $\begingroup$ +1 and welcome to the community. It's a short question but a valid one. Hopefully someone more familiar with ProjectQ can help you! $\endgroup$ Jan 24 at 2:50
1
$\begingroup$

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:

  1. Create your quantum function
  2. Iterate through each operation and obtain the matrix representation
  3. Multiply each unitary to get the final unitary representation of the circuit
$\endgroup$
1
  • 1
    $\begingroup$ Thank you for your answer. $\endgroup$ Feb 21 at 19:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.