@@ -807,33 +807,6 @@ def _cnot_rxx_decompose(plus_ry: bool = True, plus_rxx: bool = True):
807807def_sdg .append (U1Gate (- pi / 2 ), [q [0 ]], [])
808808_sel .add_equivalence (SdgGate (), def_sdg )
809809
810- # CSGate
811- #
812- # q_0: ──■── q_0: ───────■────────
813- # ┌─┴─┐ ┌───┐┌─┴──┐┌───┐
814- # q_1: ┤ S ├ = q_1: ┤ H ├┤ Sx ├┤ H ├
815- # └───┘ └───┘└────┘└───┘
816- q = QuantumRegister (2 , "q" )
817- def_cs = QuantumCircuit (q )
818- def_cs .append (HGate (), [q [1 ]], [])
819- def_cs .append (CSXGate (), [q [0 ], q [1 ]], [])
820- def_cs .append (HGate (), [q [1 ]], [])
821- _sel .add_equivalence (CSGate (), def_cs )
822-
823- # CSdgGate
824- #
825- # q_0: ───■─── q_0: ───────■────■────────
826- # ┌──┴──┐ ┌───┐┌─┴─┐┌─┴──┐┌───┐
827- # q_1: ┤ Sdg ├ = q_1: ┤ H ├┤ X ├┤ Sx ├┤ H ├
828- # └─────┘ └───┘└───┘└────┘└───┘
829- q = QuantumRegister (2 , "q" )
830- def_csdg = QuantumCircuit (q )
831- def_csdg .append (HGate (), [q [1 ]], [])
832- def_csdg .append (CXGate (), [q [0 ], q [1 ]], [])
833- def_csdg .append (CSXGate (), [q [0 ], q [1 ]], [])
834- def_csdg .append (HGate (), [q [1 ]], [])
835- _sel .add_equivalence (CSdgGate (), def_csdg )
836-
837810# SdgGate
838811#
839812# ┌─────┐ ┌───┐┌───┐
@@ -877,6 +850,65 @@ def _cnot_rxx_decompose(plus_ry: bool = True, plus_rxx: bool = True):
877850 def_sdg .append (inst , qargs , cargs )
878851_sel .add_equivalence (SdgGate (), def_sdg )
879852
853+ # CSGate
854+ #
855+ # ┌───┐
856+ # q_0: ──■── q_0: ┤ T ├──■───────────■──
857+ # ┌─┴─┐ ├───┤┌─┴─┐┌─────┐┌─┴─┐
858+ # q_1: ┤ S ├ = q_1: ┤ T ├┤ X ├┤ Tdg ├┤ X ├
859+ # └───┘ └───┘└───┘└─────┘└───┘
860+ q = QuantumRegister (2 , "q" )
861+ def_cs = QuantumCircuit (q )
862+ def_cs .append (TGate (), [q [0 ]], [])
863+ def_cs .append (TGate (), [q [1 ]], [])
864+ def_cs .append (CXGate (), [q [0 ], q [1 ]], [])
865+ def_cs .append (TdgGate (), [q [1 ]], [])
866+ def_cs .append (CXGate (), [q [0 ], q [1 ]], [])
867+ _sel .add_equivalence (CSGate (), def_cs )
868+
869+ # CSGate
870+ #
871+ # q_0: ──■── q_0: ───────■────────
872+ # ┌─┴─┐ ┌───┐┌─┴──┐┌───┐
873+ # q_1: ┤ S ├ = q_1: ┤ H ├┤ Sx ├┤ H ├
874+ # └───┘ └───┘└────┘└───┘
875+ q = QuantumRegister (2 , "q" )
876+ def_cs_csx = QuantumCircuit (q )
877+ def_cs_csx .append (HGate (), [q [1 ]], [])
878+ def_cs_csx .append (CSXGate (), [q [0 ], q [1 ]], [])
879+ def_cs_csx .append (HGate (), [q [1 ]], [])
880+ _sel .add_equivalence (CSGate (), def_cs_csx )
881+
882+ # CSdgGate
883+ #
884+ # ┌─────┐
885+ # q_0: ───■─── q_0: ──■─────────■──┤ Tdg ├
886+ # ┌──┴──┐ ┌─┴─┐┌───┐┌─┴─┐├─────┤
887+ # q_1: ┤ Sdg ├ = q_1: ┤ X ├┤ T ├┤ X ├┤ Tdg ├
888+ # └─────┘ └───┘└───┘└───┘└─────┘
889+ q = QuantumRegister (2 , "q" )
890+ def_csdg = QuantumCircuit (q )
891+ def_csdg .append (CXGate (), [q [0 ], q [1 ]], [])
892+ def_csdg .append (TGate (), [q [1 ]], [])
893+ def_csdg .append (CXGate (), [q [0 ], q [1 ]], [])
894+ def_csdg .append (TdgGate (), [q [0 ]], [])
895+ def_csdg .append (TdgGate (), [q [1 ]], [])
896+ _sel .add_equivalence (CSdgGate (), def_csdg )
897+
898+ # CSdgGate
899+ #
900+ # q_0: ───■─── q_0: ───────■────■────────
901+ # ┌──┴──┐ ┌───┐┌─┴─┐┌─┴──┐┌───┐
902+ # q_1: ┤ Sdg ├ = q_1: ┤ H ├┤ X ├┤ Sx ├┤ H ├
903+ # └─────┘ └───┘└───┘└────┘└───┘
904+ q = QuantumRegister (2 , "q" )
905+ def_csdg_csx = QuantumCircuit (q )
906+ def_csdg_csx .append (HGate (), [q [1 ]], [])
907+ def_csdg_csx .append (CXGate (), [q [0 ], q [1 ]], [])
908+ def_csdg_csx .append (CSXGate (), [q [0 ], q [1 ]], [])
909+ def_csdg_csx .append (HGate (), [q [1 ]], [])
910+ _sel .add_equivalence (CSdgGate (), def_csdg_csx )
911+
880912# SwapGate
881913# ┌───┐
882914# q_0: ─X─ q_0: ──■──┤ X ├──■──
0 commit comments