stuff-from-scratch/plugins/quantum_computing/test/TestQuantumSimulator.cpp
2023-01-26 15:16:46 +00:00

27 lines
No EOL
682 B
C++

#include "TestFramework.h"
#include "TestUtils.h"
#include "TestRenderUtils.h"
#include "QuantumCircuitReader.h"
#include "QuantumCircuitNode.h"
#include "QuantumCircuit.h"
#include "QuantumState.h"
#include "QuantumSimulator.h"
#include "File.h"
TEST_CASE(TestQuantumSimulator, "quantum_computing")
{
QuantumCircuitReader reader;
auto circuit = reader.read(TestUtils::getTestDataDir() / "quantum_circuit.dat");
QuantumSimulator simulator;
simulator.setCircuit(circuit.get());
simulator.run();
auto input_state = simulator.getInputState();
File file(TestUtils::getTestOutputDir(__FILE__) / "out.dat");
file.writeText(input_state.toString());
}