qpe_toolbox.circuit.controls¶
Routines for quimb circuits and/or gates.
Functions¶
|
Shift gate targets and controls to account for an auxiliary qubit register. |
Module Contents¶
- qpe_toolbox.circuit.controls.shift_control_gates(gates, m_aux, k_ctrl)[source]¶
Shift gate targets and controls to account for an auxiliary qubit register.
This function is used when an auxiliary (ancilla) register occupies the first
m_auxqubits of a circuit. All gates acting on the data register are shifted bym_auxin their qubit indices, and an additional control qubit from the auxiliary register is added to each gate.- Parameters:
- Returns:
controlled_gates – New list of gate objects with shifted qubit indices and added control.
- Return type:
list of Gate
- Raises:
ValueError – If
k_ctrllies outside the auxiliary register.
Notes
Target qubits
qare mapped toq + m_aux.Existing control qubits are also shifted by
m_aux.If a gate originally has no controls, it becomes singly controlled by
k_ctrl.The original gate objects are not modified.