File tree Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 1- 2.1.57
1+ 2.1.58
Original file line number Diff line number Diff line change @@ -61,6 +61,16 @@ TketError tket_two_qubit_squash(
6161TketError tket_clifford_simp (
6262 TketCircuit * circuit , TketTargetGate target_gate , bool allow_swaps );
6363
64+ /**
65+ * Squash sequences of single-qubit gates into PhasedX and Rz gates.
66+ *
67+ * Also remove identity gates. Commute Rz gates to the back if possible.
68+ *
69+ * @param circuit Circuit to transform (modified in-place)
70+ * @return TKET_SUCCESS if successful, error code otherwise
71+ */
72+ TketError tket_squash_phasedx_rz (TketCircuit * circuit );
73+
6474// Utility functions
6575const char * tket_error_string (TketError error );
6676
Original file line number Diff line number Diff line change @@ -106,6 +106,14 @@ TketError tket_clifford_simp(
106106 return TKET_SUCCESS;
107107}
108108
109+ TketError tket_squash_phasedx_rz (TketCircuit *tc) {
110+ if (!tc) return TKET_ERROR_NULL_POINTER;
111+
112+ Transforms::squash_1qb_to_Rz_PhasedX (true ).apply (tc->circuit );
113+
114+ return TKET_SUCCESS;
115+ }
116+
109117const char *tket_error_string (TketError error) {
110118 switch (error) {
111119 case TKET_SUCCESS:
You can’t perform that action at this time.
0 commit comments