qubiter.CktEmbedder module¶
-
class
qubiter.CktEmbedder.
CktEmbedder
(num_qbits_bef, num_qbits_aft, bit_map=None)[source]¶ Bases:
object
This class stores parameters for embedding a quantum circuit within a larger circuit (one with more qubits). Note that we will use the word “bit” to mean either cbits or qbits.
Variables: - bit_map (list[int]) – 1-1 but not onto map of range(num_qbits_bef) into range(num_qbits_aft)
- extra_controls (Controls) – When embedding controls, these extra ones will be added to the before embedding controls
- num_qbits_aft (int) – number of qubits after circuit embedding
- num_qbits_bef (int) – number of qubits before circuit embedding
-
__init__
(num_qbits_bef, num_qbits_aft, bit_map=None)[source]¶ Constructor
Parameters: - num_qbits_bef (int) –
- num_qbits_aft (int) –
-
aft
(bef)[source]¶ Returns bit_map[bef] if bit_map is list. If bit_map is None, returns input ‘bef’ untouched.
Parameters: bef (int) – Returns: Return type: int
-
static
composition
(emb2, emb1)[source]¶ Returns composite map emb2(emb1()). This entails defining a new CktEmbedder whose bit_map is the composition of the bit maps of the other two. Also, the extra controls of emb2 and emb1 must be merged and given to the composition.
Parameters: - emb1 (CktEmbedder) –
- emb2 (CktEmbedder) –
Returns: Return type: