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$ Commented Jan 24, 2021 at 2:50

1 Answer 1

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$ Commented Feb 21, 2021 at 19:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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