Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion TKET_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.1.57
2.1.58
10 changes: 10 additions & 0 deletions tket-c-api/include/tket-c-api.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@ TketError tket_two_qubit_squash(
TketError tket_clifford_simp(
TketCircuit *circuit, TketTargetGate target_gate, bool allow_swaps);

/**
* Squash sequences of single-qubit gates into PhasedX and Rz gates.
*
* Also remove identity gates. Commute Rz gates to the back if possible.
*
* @param circuit Circuit to transform (modified in-place)
* @return TKET_SUCCESS if successful, error code otherwise
*/
TketError tket_squash_phasedx_rz(TketCircuit *circuit);

// Utility functions
const char *tket_error_string(TketError error);

Expand Down
8 changes: 8 additions & 0 deletions tket-c-api/src/tket-c-api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,14 @@ TketError tket_clifford_simp(
return TKET_SUCCESS;
}

TketError tket_squash_phasedx_rz(TketCircuit *tc) {
if (!tc) return TKET_ERROR_NULL_POINTER;

Transforms::squash_1qb_to_Rz_PhasedX(true).apply(tc->circuit);

return TKET_SUCCESS;
}

const char *tket_error_string(TketError error) {
switch (error) {
case TKET_SUCCESS:
Expand Down
Loading