-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
⏪ add
MQT::CorePython
target back (#541)
## Description As the integration of the mqt-core Python package into the top-level tools turned out to be a much lengthier process than imagined, this PR adds back the `MQT::CorePython` target that was previously used to read in Qiskit objects. This should allow development in the top-level libraries to continue without waiting for the remaining issues with the Python package being resolved. ## Checklist: <!--- This checklist serves as a reminder of a couple of things that ensure your pull request will be merged swiftly. --> - [x] The pull request only contains commits that are related to it. - [x] I have added appropriate tests and documentation. - [x] I have made sure that all CI jobs on GitHub pass. - [x] The pull request introduces no new warnings and follows the project's style guidelines. --------- Signed-off-by: burgholzer <burgholzer@me.com>
- Loading branch information
1 parent
bd2fd7b
commit 3d5e14b
Showing
3 changed files
with
552 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#pragma once | ||
|
||
#include "pybind11/pybind11.h" | ||
#include "pybind11/pytypes.h" | ||
|
||
#include <regex> | ||
#include <type_traits> | ||
#include <variant> | ||
|
||
namespace py = pybind11; | ||
|
||
#include "QuantumComputation.hpp" | ||
|
||
namespace qc::qiskit { | ||
using namespace pybind11::literals; | ||
|
||
class QuantumCircuit { | ||
public: | ||
static void import(QuantumComputation& qc, const py::object& circ); | ||
|
||
protected: | ||
static void emplaceOperation(QuantumComputation& qc, | ||
const py::object& instruction, | ||
const py::list& qargs, const py::list& cargs, | ||
const py::list& params, const py::dict& qubitMap, | ||
const py::dict& clbitMap); | ||
|
||
static SymbolOrNumber parseSymbolicExpr(const py::object& pyExpr); | ||
|
||
static SymbolOrNumber parseParam(const py::object& param); | ||
|
||
static void addOperation(QuantumComputation& qc, OpType type, | ||
const py::list& qargs, const py::list& params, | ||
const py::dict& qubitMap); | ||
|
||
static void addTwoTargetOperation(QuantumComputation& qc, OpType type, | ||
const py::list& qargs, | ||
const py::list& params, | ||
const py::dict& qubitMap); | ||
|
||
static void importDefinition(QuantumComputation& qc, const py::object& circ, | ||
const py::list& qargs, const py::list& cargs, | ||
const py::dict& qubitMap, | ||
const py::dict& clbitMap); | ||
|
||
static void importInitialLayout(QuantumComputation& qc, | ||
const py::object& circ); | ||
}; | ||
} // namespace qc::qiskit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.