dqc_simulator.software.dqc_circuit
Defining a convenience class for encapsulating meta info on DQC circuits.
- class dqc_simulator.software.dqc_circuit.DqcCircuit(qregs, cregs, native_gates, ops, qreg2node_lookup=None, circuit_type=None)
Bases:
objectConvenience class for encapsulating meta info on DQC circuits
- Parameters
- qregsdict of dicts
The quantum registers and their associated info. Subdicts should have the keys ‘size’, and ‘starting_index’, and integer values for each.
- cregsdict
The classical registers and their associated sizes.
- native_gatesdict
The gates native to the processor upon which the DQC circuit will be enacted.
- opslist of lists
The operations (such as gates, initialisations or measurements) in the quantum circuit written in a way dqc_simulator can understand.
- qreg2node_lookupdict or None, optional
A mapping from qreg names to node names. This can be used to specify the partitioning of the circuit manually by associating each qreg with an appropriate node name
- circuit_typestr or None, optional
- Meta info indicating what is left to do to the circuit
Can be ‘monolithic’, ‘unpartitioned’ ‘prepped4partitioning’, or ‘partitioned’. TO DO: add more options like ‘optimised’.
- add_scheme_to_2_qubit_gates(scheme)
Specifies the scheme to be used for all two qubit gates.
- Parameters
scheme (str) – The scheme to be used for all remote two-qubit gates
- lock_in_gate_specs()
Renders all elements of self.ops immutable. This is useful for protecting against accidental alteration of elements in self.ops.
- replace_qreg_names(node_0_name='placeholder', node_1_name='placeholder')
Replaces node names in each gate_spec in ops with a placeholder indicating that partitioning should be done
- Parameters
- node_1_namestr, optional
The word to use for the first node in each gate_spec or an appropriate_placeholder