TransWikia.com

How can I obtain a unitary matrix of quantum circuit with angles as parametric?

Quantum Computing Asked by Moein sarvaghad on November 17, 2020

I need to draw a quantum circuit in Clifford+T library and obtain automatically its transformation matrix. (I received a response to this part of my question before in the link: How can I obtain transformation matrix of a quantum circuit in the Qiskit?) and now I want to do this work as a parametric. For example, I want to define gate T as
$$
begin{pmatrix}
1 & 0
0 & w
end{pmatrix}
$$

where $w=frac{(1+i)}{sqrt{2}}$, and I want to obtain the transformation matrix of the circuit with parameter $w$ and not as numeric. How can I do this?

One Answer

As of Qiskit 0.23.0 that's not yet supported.

The reason is mainly that such a simulator would be very slow as we would have to use SymPy's matrix multiplication for symbolic expressions. This is not really feasible for more than 5 or 6 qubits -- depending on your machine specs. Also, the output can become a gigantic symbolic expression pretty quickly and therefore likely only of limited use.

That being said, you can of course write your own script for a symbolic simulator: all you have to do is replace matrix multiplications with SymPy multiplications. A good starting point could be the quantum_info.Operator that uses straightforward NumPy multiplications and could probably be generalized easily.

Answered by Cryoris on November 17, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP