Circuit and Gates

This class is the superclass providing template functionality needed for constructing every circuit.

class circuit
annotations(self: mqt.syrec.pysyrec.circuit, arg0: syrec::Gate) dict

This method returns all annotations for a given gate.

property constants

Returns the constant input line specification.

property garbage

Returns whether outputs are garbage or not.

property inputs

Returns the input names of the lines in a circuit.

property lines

Returns the number of circuit lines.

property num_gates

Returns the total number of gates in the circuit.

property outputs

Returns the output names of the lines in a circuit.

quantum_cost(self: mqt.syrec.pysyrec.circuit) int

Returns the quantum cost of the circuit.

to_qasm_file(self: mqt.syrec.pysyrec.circuit, filename: str) bool

Writes the QASM representation of the circuit to a file.

to_qasm_str(self: mqt.syrec.pysyrec.circuit) str

Returns the QASM representation of the circuit.

transistor_cost(self: mqt.syrec.pysyrec.circuit) int

Returns the transistor cost of the circuit.

This class is the superclass providing template functionality needed for every gate.

class gate
property controls

Controls of the gate.

property targets

Targets of the gate.

property type

Type of the gate.

Enum holding different types of reversible gates.

class gate_type

Members:

toffoli : Toffoli gate type.

fredkin : Fredkin gate type.

fredkin = <gate_type.fredkin: 1>
property name
toffoli = <gate_type.toffoli: 2>
property value