6 #include "catch2/catch.hpp" 11 using namespace Catch::Matchers;
21 TEST_CASE(
"Test encoding of binary (integers) to superposition",
"[encode]"){
22 SECTION(
"Testing qubit encoding"){
67 TEST_CASE(
"Test encoding of different register sizes and checking states' amplitudes",
"[encode_amp]"){
68 const std::size_t max_qubits = 5;
69 double mach_eps = 7./3. - 4./3. -1.;
93 auto &r =
sim.getQubitRegister();
115 REQUIRE(r[i].real() + 10*mach_eps == Approx(expected_val).margin(1e-12));
116 REQUIRE(r[i].imag() + 10*mach_eps == Approx(0.).margin(1e-12) );
120 REQUIRE(r[i].real() + 10*mach_eps == Approx(0.).margin(1e-12));
121 REQUIRE(r[i].imag() + 10*mach_eps == Approx(0.).margin(1e-12) );
124 REQUIRE(r[i].real() + 10*mach_eps == Approx(0.).margin(1e-12));
125 REQUIRE(r[i].imag() + 10*mach_eps == Approx(0.).margin(1e-12) );
128 REQUIRE(r[i].real() + 10*mach_eps == Approx(0.).margin(1e-12));
129 REQUIRE(r[i].imag() + 10*mach_eps == Approx(0.).margin(1e-12) );
Class definition for IntelSimulator. The purpose of this class is to map the functionality of the und...
void encodeBinInToSuperpos_unique(SimulatorType &qSim, const std::vector< std::size_t > ®_memory, const std::vector< std::size_t > ®_auxiliary, const std::vector< std::size_t > &bin_patterns)
Encodes each element of inputted vector as a binary string in a superpostiion of states....
TEST_CASE("Test encoding of binary (integers) to superposition","[encode]")
Test binary encoding basic implementation.
Defines class which introduces routines for encoding binary numbers represented as unsigned integers ...
Definition of class to encode a binary string represented by an integer into a superposition of state...