Initial quantum circuit.

This commit is contained in:
jmsgrogan 2023-01-26 11:27:35 +00:00
parent 77ce58c612
commit 20c13c1cdf
38 changed files with 1153 additions and 14 deletions

View file

@ -1,6 +1,7 @@
list(APPEND UNIT_TEST_FILES
TestBlochSphereNode.cpp
TestQuantumCircuitParsing.cpp
)
add_executable(quantum_computing_unit_tests ${CMAKE_SOURCE_DIR}/test/test_runner.cpp ${UNIT_TEST_FILES})

View file

@ -0,0 +1,24 @@
#include "TestFramework.h"
#include "TestUtils.h"
#include "TestRenderUtils.h"
#include "QuantumCircuitReader.h"
#include "QuantumCircuitNode.h"
#include "QuantumCircuit.h"
TEST_CASE(TestQuantumCircuitParsing, "quantum_computing")
{
QuantumCircuitReader reader;
auto circuit = reader.read(TestUtils::getTestDataDir() / "quantum_circuit.dat");
TestRenderer renderer(100, 100);
auto node = std::make_unique<QuantumCircuitNode>(Point(10, 10));
node->setContent(circuit.get());
renderer.getScene()->addNode(node.get());
renderer.writeSvg(TestUtils::getTestOutputDir(__FILE__) / "circuit.svg");
}