27 lines
682 B
C++
27 lines
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());
|
||
|
}
|