quri_parts.tket.circuit.transpile package#

class TketTranspiler(backend=None, basis_gates=None, optimization_level=3)#

Bases: CircuitTranspilerProtocol

A CircuitTranspiler that uses Tket’s transpiler to convert circuits to backend-compatible circuits, convert gate sets, perform circuit optimization, etc.

This transpiler converts NonParametricQuantumCircuit to NonParametricQuantumCircuit just like other transpilers in QURI Parts though the conversion of the circuit to Tket and vice versa is performed internally.

If the backend is specified, the circuit is transformed and optimized to a form executable in the backend at the optimization level specified in optimization_level. Since the corresponding gate set in the backend takes precedence, basis_gates argument is ignored.

If the backend is not specified, conversion to the gate set specified in basis_gates and optimization in optimization_level are performed.

Note that this transpiler may perform optimization assuming that the input state of all qubits is |0>.

Parameters:
  • backend (Optional[Backend]) – Tket’s Backend instance. If specified, the gate set for the device is used for the output and the basis_gates option is ignored.

  • basis_gates (Optional[Sequence[GateNameType]]) – Specify the gate set after decomposition as a list of gate name strings.

  • optimization_level (int) – Specifies the optimization level of the circuit from 0 to 3.

Refs:

https://cqcl.github.io/pytket/manual/manual_compiler.html