Initial quantum circuit.
This commit is contained in:
parent
77ce58c612
commit
20c13c1cdf
38 changed files with 1153 additions and 14 deletions
|
@ -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})
|
||||
|
|
24
plugins/quantum_computing/test/TestQuantumCircuitParsing.cpp
Normal file
24
plugins/quantum_computing/test/TestQuantumCircuitParsing.cpp
Normal 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");
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue