Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions tests/run_qsimh_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "../lib/io.h"
#include "../lib/run_qsimh.h"
#include "../lib/simmux.h"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can delete this line.

#include "../lib/simulator_basic.h"

namespace qsim {

Expand Down Expand Up @@ -101,9 +102,9 @@ R"(4
)";

struct Factory {
using Simulator = qsim::Simulator<For>;
using fp_type = double;
using Simulator = qsim::SimulatorBasic<For, fp_type>;
using StateSpace = Simulator::StateSpace;
using fp_type = Simulator::fp_type;

static StateSpace CreateStateSpace() {
return StateSpace(1);
Expand All @@ -116,14 +117,14 @@ struct Factory {

TEST(RunQSimHTest, QSimHRunner) {
std::stringstream ss(circuit_string);
Circuit<GateQSim<float>> circuit;
Circuit<GateQSim<Factory::fp_type>> circuit;

EXPECT_TRUE(CircuitQsimParser<IO>::FromStream(99, provider, ss, circuit));
EXPECT_EQ(circuit.num_qubits, 4);
EXPECT_EQ(circuit.gates.size(), 63);

using HybridSimulator = HybridSimulator<IO, GateQSim<float>, BasicGateFuser,
For>;
using HybridSimulator =
HybridSimulator<IO, GateQSim<Factory::fp_type>, BasicGateFuser, For>;
using Runner = QSimHRunner<IO, HybridSimulator>;

Runner::Parameter param;
Expand Down Expand Up @@ -180,10 +181,10 @@ TEST(RunQSimHTest, QSimHRunner) {
}

TEST(RunQSimHTest, CirqGates) {
auto circuit = CirqCircuit1::GetCircuit<float>(false);
auto circuit = CirqCircuit1::GetCircuit<Factory::fp_type>(false);
const auto& expected_results = CirqCircuit1::expected_results0;

using HybridSimulator = HybridSimulator<IO, Cirq::GateCirq<float>,
using HybridSimulator = HybridSimulator<IO, Cirq::GateCirq<Factory::fp_type>,
BasicGateFuser, For>;
using Runner = QSimHRunner<IO, HybridSimulator>;

Expand Down
Loading