Adding custom gates to circuit

11 views
Skip to first unread message

jkur...@gmail.com

unread,
Jul 12, 2017, 7:42:27 PM7/12/17
to QuTiP: Quantum Toolbox in Python
Some of my colleagues and I are working through a quantum algorithms text. Some of the derivations used to understand the theory rely on analyzing quantum circuits with non-standard gates.

For example, in studying the Deutsch–Jozsa algorithm, the text specifies the following circuit:









where Uf can be one of four gates, including one represented by this matrix:










Is it possible to add this gate to the circuit so that this matrix is used in the set of propagators (and gate_sequence_product())?

Two other unrelated questions since I'm here and asking.

Is there a way to represent the two hadamard gates in the same index in the circuit? It ends up not mattering since h tensor h = h tensor identity * identity tensor h, which is what you get when you just add them sequentially.

Is it possible to multiply the 4x4 result of the gate_sequence_product() by a 4x1 input vector to see what the resulting vector is (the square being the measurement probabilities)? When I try to multiply two Qobj's with these dimensions it results in an error. Instead we've been using a combination of .full() and numpy.dot() (and numpy.square() for the probabilities).

Thank you all for the excellent work, we are following this package closely.

V/r
JK
Reply all
Reply to author
Forward
0 new messages