#include "catch2/catch.hpp"
#include "Simulator.hpp"
#include "IntelSimulator.cpp"
#include <memory>
#include "bit_group.hpp"
#include <bitset>
Go to the source code of this file.
◆ TEST_CASE()
TEST_CASE |
( |
"Test bit grouping" |
, |
|
|
"" |
[bitgroup] |
|
) |
| |
Test BitGroup.
Definition at line 27 of file test_bit_group.cpp.
29 std::vector<std::size_t> reg, aux;
32 else{ aux.push_back(i); }
34 std::cout << reg.size() <<
" | "<< aux.size() << std::endl;
37 auto& r =
sim.getQubitRegister();
49 SECTION(
"Group to right |010000>|10> + |011000>|10> -> |000001>|10> + |000011>|10>"){
51 sim.applyGateX(reg[1]);
52 sim.applyGateH(reg[2]);
54 sim.applyGateX(aux[0]);
57 sim.PrintStates(
"PostSuper");
Class definition for IntelSimulator. The purpose of this class is to map the functionality of the und...
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....
Class definition for bit-wise grouping in register.
References QNLP::BitGroup< SimulatorType >::bit_group(), ncu_opt_tester::num_qubits, and ncu_opt_tester::sim.