Skip to content
Merged
Show file tree
Hide file tree
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
7 changes: 0 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,3 @@ repos:
language: pygrep
name: Disallow improper capitalization
repo: local
- hooks:
- id: commitizen
- id: commitizen-branch
stages:
- pre-push
repo: https://github.com/commitizen-tools/commitizen
rev: v4.1.0
4 changes: 2 additions & 2 deletions cmake/ExternalDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ endif()

# ---------------------------------------------------------------------------------Fetch MQT Core
# cmake-format: off
set(MQT_CORE_VERSION 2.7.0
set(MQT_CORE_VERSION 3.0.2
CACHE STRING "MQT Core version")
set(MQT_CORE_REV "4176e32376f0289f616bde18e9dbb2f1333a85fb"
set(MQT_CORE_REV "9b6e01482cc77f48c828d988407ee4f8e4e93b56"
CACHE STRING "MQT Core identifier (tag, branch or commit hash)")
set(MQT_CORE_REPO_OWNER "munich-quantum-toolkit"
CACHE STRING "MQT Core repository owner (change when using a fork)")
Expand Down
4 changes: 2 additions & 2 deletions include/backend/dd/DDSimDebug.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,15 @@ struct DDSimulationState {
/**
* @brief The DD package used for simulation.
*/
std::unique_ptr<dd::Package<>> dd;
std::unique_ptr<dd::Package> dd;
/**
* @brief The iterator pointing to the current instruction in the simulation.
*/
std::vector<std::unique_ptr<qc::Operation>>::iterator iterator;
/**
* @brief The DD vector representing the current simulation state.
*/
qc::VectorDD simulationState;
dd::VectorDD simulationState;
/**
* @brief A vector containing the `InstructionType` of each instruction.
*/
Expand Down
3 changes: 2 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC ${Eigen3_Includes})

# link to the MQT::Core libraries
target_link_libraries(${PROJECT_NAME} PUBLIC MQT::CoreDD MQT::CoreIR MQT::CoreCircuitOptimizer)
target_link_libraries(${PROJECT_NAME} PRIVATE MQT::ProjectWarnings MQT::ProjectOptions)
target_link_libraries(${PROJECT_NAME} PRIVATE MQT::ProjectWarnings MQT::ProjectOptions
MQT::CoreQASM)
target_link_libraries(${PROJECT_NAME} PRIVATE Eigen3::Eigen)

# add MQT alias
Expand Down
15 changes: 8 additions & 7 deletions src/backend/dd/DDSimDebug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

#include "backend/dd/DDSimDebug.hpp"

#include "Definitions.hpp"
#include "backend/dd/DDSimDiagnostics.hpp"
#include "backend/debug.h"
#include "backend/diagnostics.h"
Expand All @@ -20,9 +19,11 @@
#include "dd/DDDefinitions.hpp"
#include "dd/Operations.hpp"
#include "dd/Package.hpp"
#include "ir/Definitions.hpp"
#include "ir/Register.hpp"
#include "ir/operations/ClassicControlledOperation.hpp"
#include "ir/operations/OpType.hpp"
#include "qasm3/Importer.hpp"

#include <Eigen/Dense>
#include <algorithm>
Expand Down Expand Up @@ -140,7 +141,7 @@ Result ddsimInit(SimulationState* self) {

ddsim->simulationState.p = nullptr;
ddsim->qc = std::make_unique<qc::QuantumComputation>();
ddsim->dd = std::make_unique<dd::Package<>>(1);
ddsim->dd = std::make_unique<dd::Package>(1);
ddsim->iterator = ddsim->qc->begin();
ddsim->currentInstruction = 0;
ddsim->previousInstructionStack.clear();
Expand Down Expand Up @@ -174,7 +175,8 @@ Result ddsimLoadCode(SimulationState* self, const char* code) {

try {
std::stringstream ss{preprocessAssertionCode(code, ddsim)};
ddsim->qc->import(ss, qc::Format::OpenQASM3);
const auto imported = qasm3::Importer::import(ss);
ddsim->qc = std::make_unique<qc::QuantumComputation>(imported);
qc::CircuitOptimizer::flattenOperations(*ddsim->qc, true);
} catch (const std::exception& e) {
std::cerr << e.what() << "\n";
Expand Down Expand Up @@ -349,7 +351,7 @@ Result ddsimStepForward(SimulationState* self) {
return OK;
}

qc::MatrixDD currDD;
dd::MatrixDD currDD;
if ((*ddsim->iterator)->getType() == qc::Measure) {
// Perform a measurement of the desired qubits, based on the amplitudes of
// the current state.
Expand Down Expand Up @@ -492,7 +494,7 @@ Result ddsimStepBackward(SimulationState* self) {
}

ddsim->iterator--;
qc::MatrixDD currDD;
dd::MatrixDD currDD;

if ((*ddsim->iterator)->getType() == qc::Barrier) {
return OK;
Expand Down Expand Up @@ -1561,9 +1563,8 @@ void compileProjectiveMeasurement(
const auto& assertion = dynamic_cast<CircuitEqualityAssertion&>(
*ddsim->assertionInstructions[assertionIndex].get());

qc::QuantumComputation newQc;
std::stringstream codeStream{assertion.getCircuitCode()};
newQc.import(codeStream, qc::Format::OpenQASM3);
auto newQc = qasm3::Importer::import(codeStream);

newQc.unifyQuantumRegisters("assert_qubit");

Expand Down
Loading