QuantestPy / quantestpy

Apache License 2.0
9 stars 3 forks source link

Add cy, cz, ch gates of QASM2.0 to TestCircuit #67

Closed mitz1012 closed 2 years ago

mitz1012 commented 2 years ago

This issue is separated from issue41.

Because the definition of ch gate in QASM paper is wrong, I find the correct expression as follows:

from qiskit import QuantumCircuit
circ = QuantumCircuit(2)
circ.ch(0, 1)
circ_decomposed = circ2.decompose()
print(circ_decomposed.draw())

q_0: ─────────────────■─────────────────────
     ┌───┐┌───┐┌───┐┌─┴─┐┌─────┐┌───┐┌─────┐
q_1: ┤ S ├┤ H ├┤ T ├┤ X ├┤ Tdg ├┤ H ├┤ Sdg ├
     └───┘└───┘└───┘└───┘└─────┘└───┘└─────┘