QNLP
v1.0
|
Class definition for bit-wise grouping in register. More...
#include <bit_group.hpp>
Static Public Member Functions | |
static void | bit_group (SimulatorType &qSim, const std::vector< std::size_t > &qreg_idx, const std::vector< std::size_t > &qaux_idx, bool lsb=true) |
Swaps all qubits in register indices given by qreg_idx to their right-most positions. Method works by pairing qubits using even-odd indexed cycles iteratively until all qubits are in the correct positions. Intermediate qubit reset operation may not be realisable on all platforms (Hadarmard followed by SigmaZ projection to |0>) More... | |
Static Private Member Functions | |
static void | q_ops (SimulatorType &qSim, std::size_t qreg_idx0, std::size_t qreg_idx1, const std::vector< std::size_t > &qaux_idx) |
Swap the qubits if qreg_idx0 is set and qreg_idx1 is not. Uses Auxiliary qubits qaux_idx which are set to |10> at start and end of operations. More... | |
static void | bit_swap_pair (SimulatorType &qSim, const std::vector< std::size_t > &qreg_idx, const std::vector< std::size_t > &qaux_idx, bool lsb) |
Swaps all qubits in register indices given by qreg_idx to their right-most positions. Method works by pairing qubits using even-odd indexed cycles iteratively until all qubits are in the correct positions. More... | |
Class definition for bit-wise grouping in register.
SimulatorType |
Definition at line 25 of file bit_group.hpp.
|
inlinestatic |
Swaps all qubits in register indices given by qreg_idx to their right-most positions. Method works by pairing qubits using even-odd indexed cycles iteratively until all qubits are in the correct positions. Intermediate qubit reset operation may not be realisable on all platforms (Hadarmard followed by SigmaZ projection to |0>)
qSim | Quantum simulator object derived from SimulatorGeneral |
qreg_idx | Indices of the qSim register to group to the LSB position. |
qaux_idx | Indices of auxiliary qubits in qSim register in |00> state |
lsb | Indicates if to shift the values to the MSB or LSB equivalent positions. |
Definition at line 114 of file bit_group.hpp.
References QNLP::BitGroup< SimulatorType >::bit_swap_pair().
Referenced by QNLP::SimulatorGeneral< IntelSimulator >::groupQubits(), and TEST_CASE().
|
inlinestaticprivate |
Swaps all qubits in register indices given by qreg_idx to their right-most positions. Method works by pairing qubits using even-odd indexed cycles iteratively until all qubits are in the correct positions.
qSim | Quantum simulator object derived from SimulatorGeneral |
qreg_idx | Indices of the qSim register to group to the LSB position. |
qaux_idx | Indices of auxiliary qubits in qSim register in |00> state |
Definition at line 83 of file bit_group.hpp.
References QNLP::BitGroup< SimulatorType >::q_ops().
Referenced by QNLP::BitGroup< SimulatorType >::bit_group().
|
inlinestaticprivate |
Swap the qubits if qreg_idx0
is set and qreg_idx1
is not. Uses Auxiliary qubits qaux_idx
which are set to |10> at start and end of operations.
qSim | Quantum simulator object derived from SimulatorGeneral |
qreg_idx0 | Index of qubit 0 in qSim qubit register |
qreg_idx1 | Index of qubit 1 in qSim qubit register |
qaux_idx | Indices of auxiliary qubits in qSim qubit register that are set to |10> |
Definition at line 36 of file bit_group.hpp.
Referenced by QNLP::BitGroup< SimulatorType >::bit_swap_pair().