API documentation¶
Backends for processing pytket circuits with Quantinuum devices
- enum pytket.qir.QIRFormat(value)[source]¶
Return types qir, options are BINARY for a binary output and STRING for a string output
Valid values are as follows:
- BINARY = <QIRFormat.BINARY: 0>¶
- STRING = <QIRFormat.STRING: 1>¶
- enum pytket.qir.QIRProfile(value)[source]¶
Profile for the QIR generation
Valid values are as follows:
- BASE = <QIRProfile.BASE: 0>¶
- ADAPTIVE = <QIRProfile.ADAPTIVE: 1>¶
- ADAPTIVE_CREGSIZE = <QIRProfile.ADAPTIVE_CREGSIZE: 2>¶
- PYTKET = <QIRProfile.PYTKET: 3>¶
- pytket.qir.pytket_to_qir(circ, name='Generated from input pytket circuit', qir_format=QIRFormat.BINARY, int_type=64, cut_pytket_register=False, profile=QIRProfile.PYTKET)[source]¶
converts given pytket circuit to qir
- Parameters:
circ (
Circuit
) – given circuitname (
str
) – name for the qir module createdqir_format (
QIRFormat
) – format of the generated qir, default value is binarywfh – wasm file handler used when creating the circuit. Only needed when there are wasm calls in the circuit.
int_type (
int
) – size of each integer, allowed value 32 and 64cut_pytket_register (
bool
) – breaks up the internal scratch bit registers into smaller registers, default value falseprofile (
QIRProfile
) – generates QIR corresponding to the selected profile: Use QIRProfile.BASE for the base profile, see: https://github.com/qir-alliance/qir-spec/blob/main/specification/under_development/profiles/Base_Profile.md Use QIRProfile.ADAPTIVE for the adaptive profile, see: https://github.com/qir-alliance/qir-spec/tree/main/specification/under_development/profiles/Adaptive_Profile.md Use QIRProfile.ADAPTIVE_CREGSIZE for the adaptive profile with additional truncation operation to assure that integers matching the classical registers have no unexpected set bits, see: https://github.com/qir-alliance/qir-spec/tree/main/specification/under_development/profiles/Adaptive_Profile.md Use QIRProfile.PYTKET for QIR with additonal function for classical registers.
- Return type: