mqt-core 3.1.0__cp313-cp313t-win_arm64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of mqt-core might be problematic. Click here for more details.
- mqt/core/__init__.py +89 -0
- mqt/core/__main__.py +55 -0
- mqt/core/_commands.py +52 -0
- mqt/core/_compat/__init__.py +11 -0
- mqt/core/_compat/typing.py +29 -0
- mqt/core/_version.py +21 -0
- mqt/core/_version.pyi +12 -0
- mqt/core/bin/mqt-core-algorithms.dll +0 -0
- mqt/core/bin/mqt-core-circuit-optimizer.dll +0 -0
- mqt/core/bin/mqt-core-dd.dll +0 -0
- mqt/core/bin/mqt-core-ds.dll +0 -0
- mqt/core/bin/mqt-core-ir.dll +0 -0
- mqt/core/bin/mqt-core-na.dll +0 -0
- mqt/core/bin/mqt-core-qasm.dll +0 -0
- mqt/core/bin/mqt-core-zx.dll +0 -0
- mqt/core/dd.cp313t-win_arm64.pyd +0 -0
- mqt/core/dd.pyi +1031 -0
- mqt/core/dd_evaluation.py +368 -0
- mqt/core/include/mqt-core/algorithms/BernsteinVazirani.hpp +39 -0
- mqt/core/include/mqt-core/algorithms/GHZState.hpp +18 -0
- mqt/core/include/mqt-core/algorithms/Grover.hpp +33 -0
- mqt/core/include/mqt-core/algorithms/QFT.hpp +21 -0
- mqt/core/include/mqt-core/algorithms/QPE.hpp +30 -0
- mqt/core/include/mqt-core/algorithms/RandomCliffordCircuit.hpp +22 -0
- mqt/core/include/mqt-core/algorithms/StatePreparation.hpp +43 -0
- mqt/core/include/mqt-core/algorithms/WState.hpp +18 -0
- mqt/core/include/mqt-core/algorithms/mqt_core_algorithms_export.h +43 -0
- mqt/core/include/mqt-core/boost/config/abi/borland_prefix.hpp +27 -0
- mqt/core/include/mqt-core/boost/config/abi/borland_suffix.hpp +12 -0
- mqt/core/include/mqt-core/boost/config/abi/msvc_prefix.hpp +22 -0
- mqt/core/include/mqt-core/boost/config/abi/msvc_suffix.hpp +8 -0
- mqt/core/include/mqt-core/boost/config/abi_prefix.hpp +25 -0
- mqt/core/include/mqt-core/boost/config/abi_suffix.hpp +25 -0
- mqt/core/include/mqt-core/boost/config/assert_cxx03.hpp +211 -0
- mqt/core/include/mqt-core/boost/config/assert_cxx11.hpp +212 -0
- mqt/core/include/mqt-core/boost/config/assert_cxx14.hpp +47 -0
- mqt/core/include/mqt-core/boost/config/assert_cxx17.hpp +65 -0
- mqt/core/include/mqt-core/boost/config/assert_cxx20.hpp +59 -0
- mqt/core/include/mqt-core/boost/config/assert_cxx23.hpp +41 -0
- mqt/core/include/mqt-core/boost/config/assert_cxx98.hpp +23 -0
- mqt/core/include/mqt-core/boost/config/auto_link.hpp +525 -0
- mqt/core/include/mqt-core/boost/config/compiler/borland.hpp +342 -0
- mqt/core/include/mqt-core/boost/config/compiler/clang.hpp +370 -0
- mqt/core/include/mqt-core/boost/config/compiler/clang_version.hpp +89 -0
- mqt/core/include/mqt-core/boost/config/compiler/codegear.hpp +389 -0
- mqt/core/include/mqt-core/boost/config/compiler/comeau.hpp +59 -0
- mqt/core/include/mqt-core/boost/config/compiler/common_edg.hpp +185 -0
- mqt/core/include/mqt-core/boost/config/compiler/compaq_cxx.hpp +19 -0
- mqt/core/include/mqt-core/boost/config/compiler/cray.hpp +446 -0
- mqt/core/include/mqt-core/boost/config/compiler/diab.hpp +26 -0
- mqt/core/include/mqt-core/boost/config/compiler/digitalmars.hpp +146 -0
- mqt/core/include/mqt-core/boost/config/compiler/gcc.hpp +386 -0
- mqt/core/include/mqt-core/boost/config/compiler/gcc_xml.hpp +115 -0
- mqt/core/include/mqt-core/boost/config/compiler/greenhills.hpp +28 -0
- mqt/core/include/mqt-core/boost/config/compiler/hp_acc.hpp +153 -0
- mqt/core/include/mqt-core/boost/config/compiler/intel.hpp +577 -0
- mqt/core/include/mqt-core/boost/config/compiler/kai.hpp +33 -0
- mqt/core/include/mqt-core/boost/config/compiler/metrowerks.hpp +201 -0
- mqt/core/include/mqt-core/boost/config/compiler/mpw.hpp +143 -0
- mqt/core/include/mqt-core/boost/config/compiler/nvcc.hpp +64 -0
- mqt/core/include/mqt-core/boost/config/compiler/pathscale.hpp +141 -0
- mqt/core/include/mqt-core/boost/config/compiler/pgi.hpp +23 -0
- mqt/core/include/mqt-core/boost/config/compiler/sgi_mipspro.hpp +29 -0
- mqt/core/include/mqt-core/boost/config/compiler/sunpro_cc.hpp +225 -0
- mqt/core/include/mqt-core/boost/config/compiler/vacpp.hpp +189 -0
- mqt/core/include/mqt-core/boost/config/compiler/visualc.hpp +398 -0
- mqt/core/include/mqt-core/boost/config/compiler/xlcpp.hpp +303 -0
- mqt/core/include/mqt-core/boost/config/compiler/xlcpp_zos.hpp +174 -0
- mqt/core/include/mqt-core/boost/config/detail/cxx_composite.hpp +218 -0
- mqt/core/include/mqt-core/boost/config/detail/posix_features.hpp +95 -0
- mqt/core/include/mqt-core/boost/config/detail/select_compiler_config.hpp +157 -0
- mqt/core/include/mqt-core/boost/config/detail/select_platform_config.hpp +147 -0
- mqt/core/include/mqt-core/boost/config/detail/select_stdlib_config.hpp +121 -0
- mqt/core/include/mqt-core/boost/config/detail/suffix.hpp +1334 -0
- mqt/core/include/mqt-core/boost/config/header_deprecated.hpp +26 -0
- mqt/core/include/mqt-core/boost/config/helper_macros.hpp +37 -0
- mqt/core/include/mqt-core/boost/config/no_tr1/cmath.hpp +28 -0
- mqt/core/include/mqt-core/boost/config/no_tr1/complex.hpp +28 -0
- mqt/core/include/mqt-core/boost/config/no_tr1/functional.hpp +28 -0
- mqt/core/include/mqt-core/boost/config/no_tr1/memory.hpp +28 -0
- mqt/core/include/mqt-core/boost/config/no_tr1/utility.hpp +28 -0
- mqt/core/include/mqt-core/boost/config/platform/aix.hpp +33 -0
- mqt/core/include/mqt-core/boost/config/platform/amigaos.hpp +15 -0
- mqt/core/include/mqt-core/boost/config/platform/beos.hpp +26 -0
- mqt/core/include/mqt-core/boost/config/platform/bsd.hpp +83 -0
- mqt/core/include/mqt-core/boost/config/platform/cloudabi.hpp +18 -0
- mqt/core/include/mqt-core/boost/config/platform/cray.hpp +18 -0
- mqt/core/include/mqt-core/boost/config/platform/cygwin.hpp +71 -0
- mqt/core/include/mqt-core/boost/config/platform/haiku.hpp +31 -0
- mqt/core/include/mqt-core/boost/config/platform/hpux.hpp +87 -0
- mqt/core/include/mqt-core/boost/config/platform/irix.hpp +31 -0
- mqt/core/include/mqt-core/boost/config/platform/linux.hpp +106 -0
- mqt/core/include/mqt-core/boost/config/platform/macos.hpp +87 -0
- mqt/core/include/mqt-core/boost/config/platform/qnxnto.hpp +31 -0
- mqt/core/include/mqt-core/boost/config/platform/solaris.hpp +31 -0
- mqt/core/include/mqt-core/boost/config/platform/symbian.hpp +97 -0
- mqt/core/include/mqt-core/boost/config/platform/vms.hpp +25 -0
- mqt/core/include/mqt-core/boost/config/platform/vxworks.hpp +422 -0
- mqt/core/include/mqt-core/boost/config/platform/wasm.hpp +23 -0
- mqt/core/include/mqt-core/boost/config/platform/win32.hpp +90 -0
- mqt/core/include/mqt-core/boost/config/platform/zos.hpp +32 -0
- mqt/core/include/mqt-core/boost/config/pragma_message.hpp +31 -0
- mqt/core/include/mqt-core/boost/config/requires_threads.hpp +92 -0
- mqt/core/include/mqt-core/boost/config/stdlib/dinkumware.hpp +324 -0
- mqt/core/include/mqt-core/boost/config/stdlib/libcomo.hpp +93 -0
- mqt/core/include/mqt-core/boost/config/stdlib/libcpp.hpp +180 -0
- mqt/core/include/mqt-core/boost/config/stdlib/libstdcpp3.hpp +482 -0
- mqt/core/include/mqt-core/boost/config/stdlib/modena.hpp +79 -0
- mqt/core/include/mqt-core/boost/config/stdlib/msl.hpp +98 -0
- mqt/core/include/mqt-core/boost/config/stdlib/roguewave.hpp +208 -0
- mqt/core/include/mqt-core/boost/config/stdlib/sgi.hpp +168 -0
- mqt/core/include/mqt-core/boost/config/stdlib/stlport.hpp +258 -0
- mqt/core/include/mqt-core/boost/config/stdlib/vacpp.hpp +74 -0
- mqt/core/include/mqt-core/boost/config/stdlib/xlcpp_zos.hpp +61 -0
- mqt/core/include/mqt-core/boost/config/user.hpp +133 -0
- mqt/core/include/mqt-core/boost/config/warning_disable.hpp +47 -0
- mqt/core/include/mqt-core/boost/config/workaround.hpp +305 -0
- mqt/core/include/mqt-core/boost/config.hpp +67 -0
- mqt/core/include/mqt-core/boost/cstdint.hpp +556 -0
- mqt/core/include/mqt-core/boost/cxx11_char_types.hpp +70 -0
- mqt/core/include/mqt-core/boost/detail/workaround.hpp +10 -0
- mqt/core/include/mqt-core/boost/limits.hpp +146 -0
- mqt/core/include/mqt-core/boost/multiprecision/complex128.hpp +24 -0
- mqt/core/include/mqt-core/boost/multiprecision/complex_adaptor.hpp +1046 -0
- mqt/core/include/mqt-core/boost/multiprecision/concepts/mp_number_archetypes.hpp +257 -0
- mqt/core/include/mqt-core/boost/multiprecision/cpp_bin_float/io.hpp +698 -0
- mqt/core/include/mqt-core/boost/multiprecision/cpp_bin_float/transcendental.hpp +157 -0
- mqt/core/include/mqt-core/boost/multiprecision/cpp_bin_float.hpp +2297 -0
- mqt/core/include/mqt-core/boost/multiprecision/cpp_complex.hpp +12 -0
- mqt/core/include/mqt-core/boost/multiprecision/cpp_dec_float.hpp +3690 -0
- mqt/core/include/mqt-core/boost/multiprecision/cpp_int/add.hpp +368 -0
- mqt/core/include/mqt-core/boost/multiprecision/cpp_int/add_unsigned.hpp +387 -0
- mqt/core/include/mqt-core/boost/multiprecision/cpp_int/bitwise.hpp +889 -0
- mqt/core/include/mqt-core/boost/multiprecision/cpp_int/checked.hpp +178 -0
- mqt/core/include/mqt-core/boost/multiprecision/cpp_int/comparison.hpp +374 -0
- mqt/core/include/mqt-core/boost/multiprecision/cpp_int/cpp_int_config.hpp +161 -0
- mqt/core/include/mqt-core/boost/multiprecision/cpp_int/divide.hpp +703 -0
- mqt/core/include/mqt-core/boost/multiprecision/cpp_int/import_export.hpp +248 -0
- mqt/core/include/mqt-core/boost/multiprecision/cpp_int/intel_intrinsics.hpp +138 -0
- mqt/core/include/mqt-core/boost/multiprecision/cpp_int/limits.hpp +282 -0
- mqt/core/include/mqt-core/boost/multiprecision/cpp_int/literals.hpp +295 -0
- mqt/core/include/mqt-core/boost/multiprecision/cpp_int/misc.hpp +1457 -0
- mqt/core/include/mqt-core/boost/multiprecision/cpp_int/multiply.hpp +848 -0
- mqt/core/include/mqt-core/boost/multiprecision/cpp_int/serialize.hpp +211 -0
- mqt/core/include/mqt-core/boost/multiprecision/cpp_int/value_pack.hpp +42 -0
- mqt/core/include/mqt-core/boost/multiprecision/cpp_int.hpp +2360 -0
- mqt/core/include/mqt-core/boost/multiprecision/debug_adaptor.hpp +760 -0
- mqt/core/include/mqt-core/boost/multiprecision/detail/assert.hpp +29 -0
- mqt/core/include/mqt-core/boost/multiprecision/detail/atomic.hpp +62 -0
- mqt/core/include/mqt-core/boost/multiprecision/detail/bitscan.hpp +317 -0
- mqt/core/include/mqt-core/boost/multiprecision/detail/check_cpp11_config.hpp +64 -0
- mqt/core/include/mqt-core/boost/multiprecision/detail/constexpr.hpp +88 -0
- mqt/core/include/mqt-core/boost/multiprecision/detail/default_ops.hpp +4052 -0
- mqt/core/include/mqt-core/boost/multiprecision/detail/digits.hpp +49 -0
- mqt/core/include/mqt-core/boost/multiprecision/detail/dynamic_array.hpp +44 -0
- mqt/core/include/mqt-core/boost/multiprecision/detail/empty_value.hpp +87 -0
- mqt/core/include/mqt-core/boost/multiprecision/detail/endian.hpp +35 -0
- mqt/core/include/mqt-core/boost/multiprecision/detail/et_ops.hpp +1831 -0
- mqt/core/include/mqt-core/boost/multiprecision/detail/float128_functions.hpp +95 -0
- mqt/core/include/mqt-core/boost/multiprecision/detail/float_string_cvt.hpp +333 -0
- mqt/core/include/mqt-core/boost/multiprecision/detail/fpclassify.hpp +101 -0
- mqt/core/include/mqt-core/boost/multiprecision/detail/functions/constants.hpp +288 -0
- mqt/core/include/mqt-core/boost/multiprecision/detail/functions/pow.hpp +905 -0
- mqt/core/include/mqt-core/boost/multiprecision/detail/functions/trig.hpp +1058 -0
- mqt/core/include/mqt-core/boost/multiprecision/detail/functions/trunc.hpp +82 -0
- mqt/core/include/mqt-core/boost/multiprecision/detail/generic_interconvert.hpp +687 -0
- mqt/core/include/mqt-core/boost/multiprecision/detail/hash.hpp +56 -0
- mqt/core/include/mqt-core/boost/multiprecision/detail/integer_ops.hpp +474 -0
- mqt/core/include/mqt-core/boost/multiprecision/detail/itos.hpp +39 -0
- mqt/core/include/mqt-core/boost/multiprecision/detail/min_max.hpp +106 -0
- mqt/core/include/mqt-core/boost/multiprecision/detail/no_et_ops.hpp +661 -0
- mqt/core/include/mqt-core/boost/multiprecision/detail/no_exceptions_support.hpp +55 -0
- mqt/core/include/mqt-core/boost/multiprecision/detail/number_base.hpp +1656 -0
- mqt/core/include/mqt-core/boost/multiprecision/detail/number_compare.hpp +848 -0
- mqt/core/include/mqt-core/boost/multiprecision/detail/precision.hpp +313 -0
- mqt/core/include/mqt-core/boost/multiprecision/detail/rebind.hpp +19 -0
- mqt/core/include/mqt-core/boost/multiprecision/detail/standalone_config.hpp +148 -0
- mqt/core/include/mqt-core/boost/multiprecision/detail/static_array.hpp +42 -0
- mqt/core/include/mqt-core/boost/multiprecision/detail/string_helpers.hpp +48 -0
- mqt/core/include/mqt-core/boost/multiprecision/detail/tables.hpp +80 -0
- mqt/core/include/mqt-core/boost/multiprecision/detail/ublas_interop.hpp +75 -0
- mqt/core/include/mqt-core/boost/multiprecision/detail/uniform_int_distribution.hpp +212 -0
- mqt/core/include/mqt-core/boost/multiprecision/detail/utype_helper.hpp +374 -0
- mqt/core/include/mqt-core/boost/multiprecision/eigen.hpp +248 -0
- mqt/core/include/mqt-core/boost/multiprecision/float128.hpp +920 -0
- mqt/core/include/mqt-core/boost/multiprecision/fwd.hpp +268 -0
- mqt/core/include/mqt-core/boost/multiprecision/gmp.hpp +4060 -0
- mqt/core/include/mqt-core/boost/multiprecision/integer.hpp +363 -0
- mqt/core/include/mqt-core/boost/multiprecision/logged_adaptor.hpp +834 -0
- mqt/core/include/mqt-core/boost/multiprecision/miller_rabin.hpp +221 -0
- mqt/core/include/mqt-core/boost/multiprecision/mpc.hpp +1721 -0
- mqt/core/include/mqt-core/boost/multiprecision/mpfi.hpp +2559 -0
- mqt/core/include/mqt-core/boost/multiprecision/mpfr.hpp +3644 -0
- mqt/core/include/mqt-core/boost/multiprecision/number.hpp +2500 -0
- mqt/core/include/mqt-core/boost/multiprecision/random.hpp +23 -0
- mqt/core/include/mqt-core/boost/multiprecision/rational_adaptor.hpp +1289 -0
- mqt/core/include/mqt-core/boost/multiprecision/tommath.hpp +1034 -0
- mqt/core/include/mqt-core/boost/multiprecision/traits/explicit_conversion.hpp +67 -0
- mqt/core/include/mqt-core/boost/multiprecision/traits/extract_exponent_type.hpp +28 -0
- mqt/core/include/mqt-core/boost/multiprecision/traits/is_backend.hpp +91 -0
- mqt/core/include/mqt-core/boost/multiprecision/traits/is_byte_container.hpp +51 -0
- mqt/core/include/mqt-core/boost/multiprecision/traits/is_complex.hpp +22 -0
- mqt/core/include/mqt-core/boost/multiprecision/traits/is_convertible_arithmetic.hpp +51 -0
- mqt/core/include/mqt-core/boost/multiprecision/traits/is_restricted_conversion.hpp +47 -0
- mqt/core/include/mqt-core/boost/multiprecision/traits/is_variable_precision.hpp +25 -0
- mqt/core/include/mqt-core/boost/multiprecision/traits/max_digits10.hpp +79 -0
- mqt/core/include/mqt-core/boost/multiprecision/traits/std_integer_traits.hpp +90 -0
- mqt/core/include/mqt-core/boost/multiprecision/traits/transcendental_reduction_type.hpp +21 -0
- mqt/core/include/mqt-core/boost/version.hpp +32 -0
- mqt/core/include/mqt-core/circuit_optimizer/CircuitOptimizer.hpp +106 -0
- mqt/core/include/mqt-core/circuit_optimizer/mqt_core_circuit_optimizer_export.h +43 -0
- mqt/core/include/mqt-core/datastructures/DirectedAcyclicGraph.hpp +117 -0
- mqt/core/include/mqt-core/datastructures/DirectedGraph.hpp +158 -0
- mqt/core/include/mqt-core/datastructures/DisjointSet.hpp +50 -0
- mqt/core/include/mqt-core/datastructures/Layer.hpp +172 -0
- mqt/core/include/mqt-core/datastructures/SymmetricMatrix.hpp +57 -0
- mqt/core/include/mqt-core/datastructures/UndirectedGraph.hpp +227 -0
- mqt/core/include/mqt-core/datastructures/mqt_core_ds_export.h +43 -0
- mqt/core/include/mqt-core/dd/Approximation.hpp +45 -0
- mqt/core/include/mqt-core/dd/CachedEdge.hpp +167 -0
- mqt/core/include/mqt-core/dd/Complex.hpp +165 -0
- mqt/core/include/mqt-core/dd/ComplexNumbers.hpp +150 -0
- mqt/core/include/mqt-core/dd/ComplexValue.hpp +184 -0
- mqt/core/include/mqt-core/dd/ComputeTable.hpp +183 -0
- mqt/core/include/mqt-core/dd/DDDefinitions.hpp +139 -0
- mqt/core/include/mqt-core/dd/DDpackageConfig.hpp +104 -0
- mqt/core/include/mqt-core/dd/DensityNoiseTable.hpp +114 -0
- mqt/core/include/mqt-core/dd/Edge.hpp +416 -0
- mqt/core/include/mqt-core/dd/Export.hpp +438 -0
- mqt/core/include/mqt-core/dd/FunctionalityConstruction.hpp +75 -0
- mqt/core/include/mqt-core/dd/GateMatrixDefinitions.hpp +43 -0
- mqt/core/include/mqt-core/dd/LinkedListBase.hpp +45 -0
- mqt/core/include/mqt-core/dd/MemoryManager.hpp +193 -0
- mqt/core/include/mqt-core/dd/Node.hpp +223 -0
- mqt/core/include/mqt-core/dd/NoiseFunctionality.hpp +144 -0
- mqt/core/include/mqt-core/dd/Operations.hpp +308 -0
- mqt/core/include/mqt-core/dd/Package.hpp +2036 -0
- mqt/core/include/mqt-core/dd/Package_fwd.hpp +22 -0
- mqt/core/include/mqt-core/dd/RealNumber.hpp +255 -0
- mqt/core/include/mqt-core/dd/RealNumberUniqueTable.hpp +217 -0
- mqt/core/include/mqt-core/dd/Simulation.hpp +98 -0
- mqt/core/include/mqt-core/dd/StateGeneration.hpp +143 -0
- mqt/core/include/mqt-core/dd/StochasticNoiseOperationTable.hpp +88 -0
- mqt/core/include/mqt-core/dd/UnaryComputeTable.hpp +121 -0
- mqt/core/include/mqt-core/dd/UniqueTable.hpp +243 -0
- mqt/core/include/mqt-core/dd/mqt_core_dd_export.h +43 -0
- mqt/core/include/mqt-core/dd/statistics/MemoryManagerStatistics.hpp +84 -0
- mqt/core/include/mqt-core/dd/statistics/PackageStatistics.hpp +55 -0
- mqt/core/include/mqt-core/dd/statistics/Statistics.hpp +48 -0
- mqt/core/include/mqt-core/dd/statistics/TableStatistics.hpp +79 -0
- mqt/core/include/mqt-core/dd/statistics/UniqueTableStatistics.hpp +31 -0
- mqt/core/include/mqt-core/ir/Definitions.hpp +108 -0
- mqt/core/include/mqt-core/ir/Permutation.hpp +213 -0
- mqt/core/include/mqt-core/ir/QuantumComputation.hpp +594 -0
- mqt/core/include/mqt-core/ir/Register.hpp +125 -0
- mqt/core/include/mqt-core/ir/mqt_core_ir_export.h +43 -0
- mqt/core/include/mqt-core/ir/operations/AodOperation.hpp +92 -0
- mqt/core/include/mqt-core/ir/operations/ClassicControlledOperation.hpp +156 -0
- mqt/core/include/mqt-core/ir/operations/CompoundOperation.hpp +210 -0
- mqt/core/include/mqt-core/ir/operations/Control.hpp +142 -0
- mqt/core/include/mqt-core/ir/operations/Expression.hpp +847 -0
- mqt/core/include/mqt-core/ir/operations/NonUnitaryOperation.hpp +118 -0
- mqt/core/include/mqt-core/ir/operations/OpType.hpp +115 -0
- mqt/core/include/mqt-core/ir/operations/OpType.inc +75 -0
- mqt/core/include/mqt-core/ir/operations/Operation.hpp +245 -0
- mqt/core/include/mqt-core/ir/operations/StandardOperation.hpp +138 -0
- mqt/core/include/mqt-core/ir/operations/SymbolicOperation.hpp +144 -0
- mqt/core/include/mqt-core/na/NAComputation.hpp +185 -0
- mqt/core/include/mqt-core/na/entities/Atom.hpp +62 -0
- mqt/core/include/mqt-core/na/entities/Location.hpp +154 -0
- mqt/core/include/mqt-core/na/entities/Zone.hpp +95 -0
- mqt/core/include/mqt-core/na/mqt_core_na_export.h +43 -0
- mqt/core/include/mqt-core/na/operations/GlobalCZOp.hpp +38 -0
- mqt/core/include/mqt-core/na/operations/GlobalOp.hpp +58 -0
- mqt/core/include/mqt-core/na/operations/GlobalRYOp.hpp +42 -0
- mqt/core/include/mqt-core/na/operations/LoadOp.hpp +89 -0
- mqt/core/include/mqt-core/na/operations/LocalOp.hpp +56 -0
- mqt/core/include/mqt-core/na/operations/LocalRZOp.hpp +42 -0
- mqt/core/include/mqt-core/na/operations/LocalUOp.hpp +49 -0
- mqt/core/include/mqt-core/na/operations/MoveOp.hpp +66 -0
- mqt/core/include/mqt-core/na/operations/Op.hpp +62 -0
- mqt/core/include/mqt-core/na/operations/ShuttlingOp.hpp +51 -0
- mqt/core/include/mqt-core/na/operations/StoreOp.hpp +87 -0
- mqt/core/include/mqt-core/qasm3/Exception.hpp +85 -0
- mqt/core/include/mqt-core/qasm3/Gate.hpp +65 -0
- mqt/core/include/mqt-core/qasm3/Importer.hpp +192 -0
- mqt/core/include/mqt-core/qasm3/InstVisitor.hpp +145 -0
- mqt/core/include/mqt-core/qasm3/NestedEnvironment.hpp +41 -0
- mqt/core/include/mqt-core/qasm3/Parser.hpp +170 -0
- mqt/core/include/mqt-core/qasm3/Scanner.hpp +73 -0
- mqt/core/include/mqt-core/qasm3/Statement.hpp +486 -0
- mqt/core/include/mqt-core/qasm3/Statement_fwd.hpp +39 -0
- mqt/core/include/mqt-core/qasm3/StdGates.hpp +123 -0
- mqt/core/include/mqt-core/qasm3/Token.hpp +198 -0
- mqt/core/include/mqt-core/qasm3/Types.hpp +238 -0
- mqt/core/include/mqt-core/qasm3/Types_fwd.hpp +22 -0
- mqt/core/include/mqt-core/qasm3/mqt_core_qasm_export.h +43 -0
- mqt/core/include/mqt-core/qasm3/passes/CompilerPass.hpp +22 -0
- mqt/core/include/mqt-core/qasm3/passes/ConstEvalPass.hpp +102 -0
- mqt/core/include/mqt-core/qasm3/passes/TypeCheckPass.hpp +124 -0
- mqt/core/include/mqt-core/zx/FunctionalityConstruction.hpp +125 -0
- mqt/core/include/mqt-core/zx/Rational.hpp +318 -0
- mqt/core/include/mqt-core/zx/Rules.hpp +132 -0
- mqt/core/include/mqt-core/zx/Simplify.hpp +182 -0
- mqt/core/include/mqt-core/zx/Utils.hpp +212 -0
- mqt/core/include/mqt-core/zx/ZXDefinitions.hpp +93 -0
- mqt/core/include/mqt-core/zx/ZXDiagram.hpp +480 -0
- mqt/core/include/mqt-core/zx/mqt_core_zx_export.h +43 -0
- mqt/core/ir/__init__.pyi +1998 -0
- mqt/core/ir/operations.pyi +1019 -0
- mqt/core/ir/registers.pyi +91 -0
- mqt/core/ir/symbolic.pyi +177 -0
- mqt/core/ir.cp313t-win_arm64.pyd +0 -0
- mqt/core/lib/mqt-core-algorithms.lib +0 -0
- mqt/core/lib/mqt-core-circuit-optimizer.lib +0 -0
- mqt/core/lib/mqt-core-dd.lib +0 -0
- mqt/core/lib/mqt-core-ds.lib +0 -0
- mqt/core/lib/mqt-core-ir.lib +0 -0
- mqt/core/lib/mqt-core-na.lib +0 -0
- mqt/core/lib/mqt-core-qasm.lib +0 -0
- mqt/core/lib/mqt-core-zx.lib +0 -0
- mqt/core/plugins/__init__.py +9 -0
- mqt/core/plugins/qiskit/__init__.py +19 -0
- mqt/core/plugins/qiskit/mqt_to_qiskit.py +354 -0
- mqt/core/plugins/qiskit/qiskit_to_mqt.py +455 -0
- mqt/core/py.typed +2 -0
- mqt/core/share/cmake/mqt-core/AddMQTPythonBinding.cmake +52 -0
- mqt/core/share/cmake/mqt-core/Cache.cmake +32 -0
- mqt/core/share/cmake/mqt-core/FindGMP.cmake +103 -0
- mqt/core/share/cmake/mqt-core/PackageAddTest.cmake +40 -0
- mqt/core/share/cmake/mqt-core/PreventInSourceBuilds.cmake +25 -0
- mqt/core/share/cmake/mqt-core/StandardProjectSettings.cmake +87 -0
- mqt/core/share/cmake/mqt-core/mqt-core-config-version.cmake +85 -0
- mqt/core/share/cmake/mqt-core/mqt-core-config.cmake +49 -0
- mqt/core/share/cmake/mqt-core/mqt-core-targets-release.cmake +90 -0
- mqt/core/share/cmake/mqt-core/mqt-core-targets.cmake +324 -0
- mqt_core-3.1.0.dist-info/DELVEWHEEL +2 -0
- mqt_core-3.1.0.dist-info/METADATA +168 -0
- mqt_core-3.1.0.dist-info/RECORD +343 -0
- mqt_core-3.1.0.dist-info/WHEEL +5 -0
- mqt_core-3.1.0.dist-info/entry_points.txt +4 -0
- mqt_core-3.1.0.dist-info/licenses/LICENSE.md +22 -0
- mqt_core.libs/msvcp140.dll +0 -0
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2023 - 2025 Chair for Design Automation, TUM
|
|
3
|
+
* Copyright (c) 2025 Munich Quantum Software Company GmbH
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
*
|
|
6
|
+
* SPDX-License-Identifier: MIT
|
|
7
|
+
*
|
|
8
|
+
* Licensed under the MIT License
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#pragma once
|
|
12
|
+
|
|
13
|
+
#include "ir/Definitions.hpp"
|
|
14
|
+
#include "ir/Permutation.hpp"
|
|
15
|
+
#include "ir/Register.hpp"
|
|
16
|
+
#include "ir/operations/Control.hpp"
|
|
17
|
+
#include "ir/operations/Expression.hpp"
|
|
18
|
+
#include "ir/operations/OpType.hpp"
|
|
19
|
+
#include "ir/operations/Operation.hpp"
|
|
20
|
+
#include "ir/operations/StandardOperation.hpp"
|
|
21
|
+
|
|
22
|
+
#include <cstddef>
|
|
23
|
+
#include <functional>
|
|
24
|
+
#include <memory>
|
|
25
|
+
#include <optional>
|
|
26
|
+
#include <ostream>
|
|
27
|
+
#include <variant>
|
|
28
|
+
#include <vector>
|
|
29
|
+
|
|
30
|
+
namespace qc {
|
|
31
|
+
|
|
32
|
+
class SymbolicOperation final : public StandardOperation {
|
|
33
|
+
public:
|
|
34
|
+
SymbolicOperation() = default;
|
|
35
|
+
|
|
36
|
+
[[nodiscard]] SymbolOrNumber getParameter(std::size_t i) const;
|
|
37
|
+
|
|
38
|
+
[[nodiscard]] std::vector<SymbolOrNumber> getParameters() const;
|
|
39
|
+
|
|
40
|
+
void setSymbolicParameter(const Symbolic& par, const std::size_t i) {
|
|
41
|
+
symbolicParameter.at(i) = par;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Standard Constructors
|
|
45
|
+
SymbolicOperation(Qubit target, OpType g,
|
|
46
|
+
const std::vector<SymbolOrNumber>& params = {});
|
|
47
|
+
SymbolicOperation(const Targets& targ, OpType g,
|
|
48
|
+
const std::vector<SymbolOrNumber>& params = {});
|
|
49
|
+
|
|
50
|
+
SymbolicOperation(Control control, Qubit target, OpType g,
|
|
51
|
+
const std::vector<SymbolOrNumber>& params = {});
|
|
52
|
+
SymbolicOperation(Control control, const Targets& targ, OpType g,
|
|
53
|
+
const std::vector<SymbolOrNumber>& params = {});
|
|
54
|
+
|
|
55
|
+
SymbolicOperation(const Controls& c, Qubit target, OpType g,
|
|
56
|
+
const std::vector<SymbolOrNumber>& params = {});
|
|
57
|
+
SymbolicOperation(const Controls& c, const Targets& targ, OpType g,
|
|
58
|
+
const std::vector<SymbolOrNumber>& params = {});
|
|
59
|
+
|
|
60
|
+
// MCF (cSWAP), Peres, parameterized two target Constructor
|
|
61
|
+
SymbolicOperation(const Controls& c, Qubit target0, Qubit target1, OpType g,
|
|
62
|
+
const std::vector<SymbolOrNumber>& params = {});
|
|
63
|
+
|
|
64
|
+
[[nodiscard]] std::unique_ptr<Operation> clone() const override;
|
|
65
|
+
|
|
66
|
+
[[nodiscard]] bool isSymbolicOperation() const override;
|
|
67
|
+
|
|
68
|
+
[[nodiscard]] bool isStandardOperation() const override;
|
|
69
|
+
|
|
70
|
+
[[nodiscard]] bool equals(const Operation& op, const Permutation& perm1,
|
|
71
|
+
const Permutation& perm2) const override;
|
|
72
|
+
[[nodiscard]] bool equals(const Operation& op) const override {
|
|
73
|
+
return equals(op, {}, {});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
[[noreturn]] void dumpOpenQASM(std::ostream& of,
|
|
77
|
+
const QubitIndexToRegisterMap& qubitMap,
|
|
78
|
+
const BitIndexToRegisterMap& bitMap,
|
|
79
|
+
std::size_t indent,
|
|
80
|
+
bool openQASM3) const override;
|
|
81
|
+
|
|
82
|
+
[[nodiscard]] StandardOperation
|
|
83
|
+
getInstantiatedOperation(const VariableAssignment& assignment) const;
|
|
84
|
+
|
|
85
|
+
// Instantiates this Operation
|
|
86
|
+
// Afterwards casting to StandardOperation can be done if assignment is total
|
|
87
|
+
void instantiate(const VariableAssignment& assignment);
|
|
88
|
+
|
|
89
|
+
void invert() override;
|
|
90
|
+
|
|
91
|
+
protected:
|
|
92
|
+
std::vector<std::optional<Symbolic>> symbolicParameter;
|
|
93
|
+
|
|
94
|
+
static OpType parseU3(const Symbolic& theta, fp& phi, fp& lambda);
|
|
95
|
+
static OpType parseU3(fp& theta, const Symbolic& phi, fp& lambda);
|
|
96
|
+
static OpType parseU3(fp& theta, fp& phi, const Symbolic& lambda);
|
|
97
|
+
static OpType parseU3(const Symbolic& theta, const Symbolic& phi, fp& lambda);
|
|
98
|
+
static OpType parseU3(const Symbolic& theta, fp& phi, const Symbolic& lambda);
|
|
99
|
+
static OpType parseU3(fp& theta, const Symbolic& phi, const Symbolic& lambda);
|
|
100
|
+
|
|
101
|
+
static OpType parseU2(const Symbolic& phi, const Symbolic& lambda);
|
|
102
|
+
static OpType parseU2(const Symbolic& phi, fp& lambda);
|
|
103
|
+
static OpType parseU2(fp& phi, const Symbolic& lambda);
|
|
104
|
+
|
|
105
|
+
static OpType parseU1(const Symbolic& lambda);
|
|
106
|
+
|
|
107
|
+
void checkSymbolicUgate();
|
|
108
|
+
|
|
109
|
+
void storeSymbolOrNumber(const SymbolOrNumber& param, std::size_t i);
|
|
110
|
+
|
|
111
|
+
[[nodiscard]] bool isSymbolicParameter(std::size_t i) const;
|
|
112
|
+
|
|
113
|
+
static bool isSymbol(const SymbolOrNumber& param);
|
|
114
|
+
|
|
115
|
+
static Symbolic& getSymbol(SymbolOrNumber& param);
|
|
116
|
+
|
|
117
|
+
static fp& getNumber(SymbolOrNumber& param);
|
|
118
|
+
|
|
119
|
+
void setup(const std::vector<SymbolOrNumber>& params);
|
|
120
|
+
|
|
121
|
+
[[nodiscard]] static fp
|
|
122
|
+
getInstantiation(const SymbolOrNumber& symOrNum,
|
|
123
|
+
const VariableAssignment& assignment);
|
|
124
|
+
|
|
125
|
+
void negateSymbolicParameter(std::size_t index);
|
|
126
|
+
|
|
127
|
+
void addToSymbolicParameter(std::size_t index, fp value);
|
|
128
|
+
};
|
|
129
|
+
} // namespace qc
|
|
130
|
+
|
|
131
|
+
template <> struct std::hash<qc::SymbolicOperation> {
|
|
132
|
+
std::size_t operator()(qc::SymbolicOperation const& op) const noexcept {
|
|
133
|
+
std::size_t seed = 0U;
|
|
134
|
+
qc::hashCombine(seed, std::hash<qc::Operation>{}(op));
|
|
135
|
+
for (const auto& param : op.getParameters()) {
|
|
136
|
+
if (std::holds_alternative<qc::fp>(param)) {
|
|
137
|
+
qc::hashCombine(seed, hash<qc::fp>{}(get<qc::fp>(param)));
|
|
138
|
+
} else {
|
|
139
|
+
qc::hashCombine(seed, hash<qc::Symbolic>{}(get<qc::Symbolic>(param)));
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
return seed;
|
|
143
|
+
}
|
|
144
|
+
};
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2023 - 2025 Chair for Design Automation, TUM
|
|
3
|
+
* Copyright (c) 2025 Munich Quantum Software Company GmbH
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
*
|
|
6
|
+
* SPDX-License-Identifier: MIT
|
|
7
|
+
*
|
|
8
|
+
* Licensed under the MIT License
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/** @file
|
|
12
|
+
* @brief Defines a class for representing neutral atom computations.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
#pragma once
|
|
16
|
+
|
|
17
|
+
#include "na/entities/Atom.hpp"
|
|
18
|
+
#include "na/entities/Location.hpp"
|
|
19
|
+
#include "na/entities/Zone.hpp"
|
|
20
|
+
#include "na/operations/Op.hpp"
|
|
21
|
+
|
|
22
|
+
#include <cstddef>
|
|
23
|
+
#include <memory>
|
|
24
|
+
#include <ostream>
|
|
25
|
+
#include <string>
|
|
26
|
+
#include <unordered_map>
|
|
27
|
+
#include <utility>
|
|
28
|
+
#include <vector>
|
|
29
|
+
|
|
30
|
+
namespace na {
|
|
31
|
+
/// Represents a neutral atom computation.
|
|
32
|
+
class NAComputation final {
|
|
33
|
+
protected:
|
|
34
|
+
/// The operations in the NA computation.
|
|
35
|
+
std::vector<std::unique_ptr<Op>> operations_;
|
|
36
|
+
/// The atoms used in the NA computation.
|
|
37
|
+
std::vector<std::unique_ptr<Atom>> atoms_;
|
|
38
|
+
/// The zones used in the NA computation.
|
|
39
|
+
std::vector<std::unique_ptr<Zone>> zones_;
|
|
40
|
+
/// The initial locations of the atoms.
|
|
41
|
+
std::unordered_map<const Atom*, Location> initialLocations_;
|
|
42
|
+
|
|
43
|
+
public:
|
|
44
|
+
/// Returns an iterator to the beginning of the operations.
|
|
45
|
+
[[nodiscard]] auto begin() -> auto { return operations_.begin(); }
|
|
46
|
+
|
|
47
|
+
/// Returns an iterator to the beginning of the operations.
|
|
48
|
+
[[nodiscard]] auto begin() const -> auto { return operations_.begin(); }
|
|
49
|
+
|
|
50
|
+
/// Returns an iterator to the end of the operations.
|
|
51
|
+
[[nodiscard]] auto end() -> auto { return operations_.end(); }
|
|
52
|
+
|
|
53
|
+
/// Returns an iterator to the end of the operations.
|
|
54
|
+
[[nodiscard]] auto end() const -> auto { return operations_.end(); }
|
|
55
|
+
|
|
56
|
+
/// Returns the number of operations in the NAComputation.
|
|
57
|
+
[[nodiscard]] auto size() const -> std::size_t { return operations_.size(); }
|
|
58
|
+
|
|
59
|
+
/// Returns a reference to the operation at the given index.
|
|
60
|
+
/// @param i The index of the operation.
|
|
61
|
+
/// @return A reference to the operation at the given index.
|
|
62
|
+
[[nodiscard]] auto operator[](const std::size_t i) -> Op& {
|
|
63
|
+
return *operations_[i];
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/// Returns a const reference to the operation at the given index.
|
|
67
|
+
/// @param i The index of the operation.
|
|
68
|
+
/// @return A const reference to the operation at the given index.
|
|
69
|
+
[[nodiscard]] auto operator[](const std::size_t i) const -> const Op& {
|
|
70
|
+
return *operations_[i];
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/// Clears the operations in the NAComputation.
|
|
74
|
+
auto clear() -> void { operations_.clear(); }
|
|
75
|
+
|
|
76
|
+
/// Returns the number of atoms used in the NAComputation.
|
|
77
|
+
[[nodiscard]] auto getAtomsSize() const -> std::size_t {
|
|
78
|
+
return atoms_.size();
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/// Returns the atoms used in the NAComputation.
|
|
82
|
+
[[nodiscard]] auto getAtoms() const -> auto& { return atoms_; }
|
|
83
|
+
|
|
84
|
+
/// Returns the zones used in global operations within the NAComputation.
|
|
85
|
+
[[nodiscard]] auto getZones() const -> auto& { return zones_; }
|
|
86
|
+
|
|
87
|
+
/// Returns the initial locations of the atoms.
|
|
88
|
+
[[nodiscard]] auto getInitialLocations() const -> auto& {
|
|
89
|
+
return initialLocations_;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/// Returns the location of the given atom after the given operation.
|
|
93
|
+
/// @param atom The atom to get the location for.
|
|
94
|
+
/// @param op The operation to get the location after.
|
|
95
|
+
/// @return The location of the atom after the operation.
|
|
96
|
+
[[nodiscard]] auto getLocationOfAtomAfterOperation(const Atom& atom,
|
|
97
|
+
const Op& op) const
|
|
98
|
+
-> Location;
|
|
99
|
+
|
|
100
|
+
/// Emplaces a new atom with the given name and returns a reference to the
|
|
101
|
+
/// newly created atom.
|
|
102
|
+
/// @param name The name of the atom.
|
|
103
|
+
/// @return A reference to the newly created atom.
|
|
104
|
+
auto emplaceBackAtom(std::string name) -> const Atom& {
|
|
105
|
+
return *atoms_.emplace_back(std::make_unique<Atom>(std::move(name)));
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/// Emplaces a new zone with the given name and returns a reference to the
|
|
109
|
+
/// newly created zone.
|
|
110
|
+
/// @param args The name of the zone and, optionally, the extent of the zone.
|
|
111
|
+
/// @return A reference to the newly created zone.
|
|
112
|
+
template <typename... Args>
|
|
113
|
+
auto emplaceBackZone(Args&&... args) -> const Zone& {
|
|
114
|
+
return *zones_.emplace_back(
|
|
115
|
+
std::make_unique<Zone>(std::forward<Args>(args)...));
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/// Emplaces a new initial location for the given atom with the given location
|
|
119
|
+
/// and returns a reference to the newly created location.
|
|
120
|
+
/// @param atom The atom to set the initial location for.
|
|
121
|
+
/// @param loc The location of the atom.
|
|
122
|
+
/// @return A reference to the newly created location.
|
|
123
|
+
auto emplaceInitialLocation(const Atom& atom, const Location& loc)
|
|
124
|
+
-> const Location& {
|
|
125
|
+
return initialLocations_.emplace(&atom, loc).first->second;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/// Emplaces a new initial location for the given atom with the given
|
|
129
|
+
/// arguments and returns a reference to the newly created location.
|
|
130
|
+
/// @param atom The atom to set the initial location for.
|
|
131
|
+
/// @param loc The parameters for the location of the atom.
|
|
132
|
+
/// @return A reference to the newly created location.
|
|
133
|
+
template <typename... Args>
|
|
134
|
+
auto emplaceInitialLocation(const Atom& atom, Args&&... loc)
|
|
135
|
+
-> const Location& {
|
|
136
|
+
return initialLocations_
|
|
137
|
+
.emplace(&atom,
|
|
138
|
+
Location{static_cast<double>(std::forward<Args>(loc))...})
|
|
139
|
+
.first->second;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/// Emplaces a new operation of type T with the given operation and returns a
|
|
143
|
+
/// reference to the newly created operation.
|
|
144
|
+
/// @tparam T The concrete type of the operation.
|
|
145
|
+
/// @param op The operation to emplace.
|
|
146
|
+
/// @return A reference to the newly created operation.
|
|
147
|
+
template <class T> auto emplaceBack(T&& op) -> const Op& {
|
|
148
|
+
return *operations_.emplace_back(std::make_unique<T>(std::forward<T>(op)));
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/// Emplaces a new operation of type T with the given arguments and returns a
|
|
152
|
+
/// reference to the newly created operation.
|
|
153
|
+
/// @tparam T The concrete type of the operation.
|
|
154
|
+
/// @param args The arguments for the operation.
|
|
155
|
+
/// @return A reference to the newly created operation.
|
|
156
|
+
template <class T, typename... Args>
|
|
157
|
+
auto emplaceBack(Args&&... args) -> const Op& {
|
|
158
|
+
return *operations_.emplace_back(
|
|
159
|
+
std::make_unique<T>(std::forward<Args>(args)...));
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/// Returns a string representation of the NAComputation.
|
|
163
|
+
[[nodiscard]] auto toString() const -> std::string;
|
|
164
|
+
/// Outputs the NAComputation to the given output stream, i.e., the string
|
|
165
|
+
/// returned by toString().
|
|
166
|
+
/// @param os The output stream to print the NAComputation to.
|
|
167
|
+
/// @param qc The NAComputation to print.
|
|
168
|
+
/// @return The output stream after printing the NAComputation.
|
|
169
|
+
friend auto operator<<(std::ostream& os, const NAComputation& qc)
|
|
170
|
+
-> std::ostream& {
|
|
171
|
+
return os << qc.toString();
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/// Validates the NAComputation and checks whether all AOD constraints are
|
|
175
|
+
/// fulfilled.
|
|
176
|
+
/// Specifically,
|
|
177
|
+
/// - each atom is loaded before it is moved
|
|
178
|
+
/// - the relative order of loaded atoms is preserved
|
|
179
|
+
/// - each atom is loaded before it is stored
|
|
180
|
+
/// - each atom is stored before it is loaded (again)
|
|
181
|
+
/// @returns a pair of a Boolean indicating whether the NAComputation is valid
|
|
182
|
+
/// and a string containing the error message if the NAComputation is invalid.
|
|
183
|
+
[[nodiscard]] auto validate() const -> std::pair<bool, std::string>;
|
|
184
|
+
};
|
|
185
|
+
} // namespace na
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2023 - 2025 Chair for Design Automation, TUM
|
|
3
|
+
* Copyright (c) 2025 Munich Quantum Software Company GmbH
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
*
|
|
6
|
+
* SPDX-License-Identifier: MIT
|
|
7
|
+
*
|
|
8
|
+
* Licensed under the MIT License
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/** @file
|
|
12
|
+
* @brief Defines a type for representing individual atoms.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
#pragma once
|
|
16
|
+
|
|
17
|
+
#include <ostream>
|
|
18
|
+
#include <string>
|
|
19
|
+
#include <utility>
|
|
20
|
+
|
|
21
|
+
namespace na {
|
|
22
|
+
/// Represents an atom in the NAComputation.
|
|
23
|
+
/// @details The name of the atom is used for printing the NAComputation.
|
|
24
|
+
/// To maintain the uniqueness of atoms, the name of the atom should be unique.
|
|
25
|
+
class Atom final {
|
|
26
|
+
/// The identifier of the atom.
|
|
27
|
+
std::string name_;
|
|
28
|
+
|
|
29
|
+
public:
|
|
30
|
+
/// Creates a new atom with the given name.
|
|
31
|
+
/// @param name The name of the atom.
|
|
32
|
+
explicit Atom(std::string name) : name_(std::move(name)) {}
|
|
33
|
+
|
|
34
|
+
/// Returns the name of the atom.
|
|
35
|
+
[[nodiscard]] auto getName() const -> std::string { return name_; }
|
|
36
|
+
|
|
37
|
+
/// Prints the atom to the given output stream.
|
|
38
|
+
/// @param os The output stream to print the atom to.
|
|
39
|
+
/// @param obj The atom to print.
|
|
40
|
+
/// @return The output stream after printing the atom.
|
|
41
|
+
friend auto operator<<(std::ostream& os, const Atom& obj) -> std::ostream& {
|
|
42
|
+
return os << obj.getName();
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/// Compares two atoms for equality.
|
|
46
|
+
/// @param other The atom to compare with.
|
|
47
|
+
/// @return True if the atoms are equal, false otherwise.
|
|
48
|
+
[[nodiscard]] auto operator==(const Atom& other) const -> bool {
|
|
49
|
+
if (this == &other) {
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
return name_ == other.name_;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/// Compares two atoms for inequality.
|
|
56
|
+
/// @param other The atom to compare with.
|
|
57
|
+
/// @return True if the atoms are not equal, false otherwise.
|
|
58
|
+
[[nodiscard]] auto operator!=(const Atom& other) const -> bool {
|
|
59
|
+
return !(*this == other);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
} // namespace na
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2023 - 2025 Chair for Design Automation, TUM
|
|
3
|
+
* Copyright (c) 2025 Munich Quantum Software Company GmbH
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
*
|
|
6
|
+
* SPDX-License-Identifier: MIT
|
|
7
|
+
*
|
|
8
|
+
* Licensed under the MIT License
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/** @file
|
|
12
|
+
* @brief Defines a type for representing two-dimensional locations.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
#pragma once
|
|
16
|
+
|
|
17
|
+
#include "ir/Definitions.hpp"
|
|
18
|
+
|
|
19
|
+
#include <cmath>
|
|
20
|
+
#include <cstddef>
|
|
21
|
+
#include <functional>
|
|
22
|
+
#include <iomanip>
|
|
23
|
+
#include <ios>
|
|
24
|
+
#include <ostream>
|
|
25
|
+
#include <sstream>
|
|
26
|
+
#include <string>
|
|
27
|
+
|
|
28
|
+
namespace na {
|
|
29
|
+
/// Class to store two-dimensional coordinates of type double.
|
|
30
|
+
struct Location final {
|
|
31
|
+
/// The x-coordinate of the location.
|
|
32
|
+
double x = 0;
|
|
33
|
+
/// The y-coordinate of the location.
|
|
34
|
+
double y = 0;
|
|
35
|
+
|
|
36
|
+
/// Subtracts the coordinates of the given location from this location.
|
|
37
|
+
/// @param loc The location to subtract.
|
|
38
|
+
/// @return The location resulting from the subtraction.
|
|
39
|
+
Location operator-(const Location& loc) const {
|
|
40
|
+
return {x - loc.x, y - loc.y};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/// Adds the coordinates of the given location to this location.
|
|
44
|
+
/// @param loc The location to add.
|
|
45
|
+
/// @return The location resulting from the addition.
|
|
46
|
+
Location operator+(const Location& loc) const {
|
|
47
|
+
return {x + loc.x, y + loc.y};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/// Returns the length of the vector from the origin to this location.
|
|
51
|
+
[[nodiscard]] auto length() const -> double { return std::hypot(x, y); }
|
|
52
|
+
|
|
53
|
+
/// Returns the distance between two locations.
|
|
54
|
+
[[nodiscard]] static auto distance(const Location& loc1, const Location& loc2)
|
|
55
|
+
-> double {
|
|
56
|
+
return (loc1 - loc2).length();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/// Returns a string representation of the location in the format "(x, y)".
|
|
60
|
+
[[nodiscard]] auto toString() const -> std::string {
|
|
61
|
+
std::stringstream ss;
|
|
62
|
+
ss << std::setprecision(3) << std::fixed;
|
|
63
|
+
ss << "(" << x << ", " << y << ")";
|
|
64
|
+
return ss.str();
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/// Prints the location to the given output stream.
|
|
68
|
+
/// @param os The output stream to print the location to.
|
|
69
|
+
/// @param obj The location to print.
|
|
70
|
+
/// @return The output stream after printing the location.
|
|
71
|
+
friend auto operator<<(std::ostream& os, const Location& obj)
|
|
72
|
+
-> std::ostream& {
|
|
73
|
+
return os << obj.toString();
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/// Compares two locations for equality.
|
|
77
|
+
/// @param other The location to compare with.
|
|
78
|
+
/// @return True if the locations are equal, false otherwise.
|
|
79
|
+
[[nodiscard]] auto operator==(const Location& other) const -> bool {
|
|
80
|
+
return x == other.x && y == other.y;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/// Compares two locations for inequality.
|
|
84
|
+
/// @param other The location to compare with.
|
|
85
|
+
/// @return True if the locations are not equal, false otherwise.
|
|
86
|
+
[[nodiscard]] auto operator!=(const Location& other) const -> bool {
|
|
87
|
+
return !(*this == other);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/// Compares two locations for less than.
|
|
91
|
+
/// @param other The location to compare with.
|
|
92
|
+
/// @return True if this location is less than the other location, false
|
|
93
|
+
[[nodiscard]] auto operator<(const Location& other) const -> bool {
|
|
94
|
+
return x < other.x || (x == other.x && y < other.y);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/// Compares two locations for greater than.
|
|
98
|
+
/// @param other The location to compare with.
|
|
99
|
+
/// @return True if this location is greater than the other location, false
|
|
100
|
+
[[nodiscard]] auto operator>(const Location& other) const -> bool {
|
|
101
|
+
return other < *this;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/// Compares two locations for greater than or equal.
|
|
105
|
+
/// @param other The location to compare with.
|
|
106
|
+
/// @return True if this location is greater than or equal to the other
|
|
107
|
+
[[nodiscard]] auto operator>=(const Location& other) const -> bool {
|
|
108
|
+
return !(other < *this);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/// Compares two locations for less than or equal.
|
|
112
|
+
/// @param other The location to compare with.
|
|
113
|
+
/// @return True if this location is less than or equal to the other location,
|
|
114
|
+
[[nodiscard]] auto operator<=(const Location& other) const -> bool {
|
|
115
|
+
return *this >= other;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/// Computes the Euclidean distance between this location and the given
|
|
119
|
+
/// location.
|
|
120
|
+
/// @param loc The location to compute the distance to.
|
|
121
|
+
/// @return The Euclidean distance between the two locations.
|
|
122
|
+
[[nodiscard]] auto getEuclideanDistance(const Location& loc) const -> double {
|
|
123
|
+
return (*this - loc).length();
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/// Computes the horizontal distance between this location and the given
|
|
127
|
+
/// location.
|
|
128
|
+
/// @param loc The location to compute the distance to.
|
|
129
|
+
/// @return The horizontal distance between the two locations.
|
|
130
|
+
[[nodiscard]] auto getManhattanDistanceX(const Location& loc) const
|
|
131
|
+
-> double {
|
|
132
|
+
return std::abs(x - loc.x);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/// Computes the vertical distance between this location and the given
|
|
136
|
+
/// location.
|
|
137
|
+
/// @param loc The location to compute the distance to.
|
|
138
|
+
/// @return The vertical distance between the two locations.
|
|
139
|
+
[[nodiscard]] auto getManhattanDistanceY(const Location& loc) const
|
|
140
|
+
-> double {
|
|
141
|
+
return std::abs(y - loc.y);
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
} // namespace na
|
|
145
|
+
|
|
146
|
+
/// @brief Specialization of std::hash for na::Location.
|
|
147
|
+
template <> struct std::hash<na::Location> {
|
|
148
|
+
/// @brief Hashes a pair of qc::OpType and size_t values.
|
|
149
|
+
auto operator()(const na::Location& loc) const noexcept -> size_t {
|
|
150
|
+
const size_t h1 = std::hash<double>{}(loc.x);
|
|
151
|
+
const size_t h2 = std::hash<double>{}(loc.y);
|
|
152
|
+
return qc::combineHash(h1, h2);
|
|
153
|
+
}
|
|
154
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2023 - 2025 Chair for Design Automation, TUM
|
|
3
|
+
* Copyright (c) 2025 Munich Quantum Software Company GmbH
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
*
|
|
6
|
+
* SPDX-License-Identifier: MIT
|
|
7
|
+
*
|
|
8
|
+
* Licensed under the MIT License
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/** @file
|
|
12
|
+
* @brief Defines a type for representing zones in NA architectures.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
#pragma once
|
|
16
|
+
|
|
17
|
+
#include <optional>
|
|
18
|
+
#include <ostream>
|
|
19
|
+
#include <string>
|
|
20
|
+
#include <utility>
|
|
21
|
+
|
|
22
|
+
namespace na {
|
|
23
|
+
|
|
24
|
+
struct Location;
|
|
25
|
+
|
|
26
|
+
/// Represents a zone in the NAComputation.
|
|
27
|
+
/// @details The name of the zone is used for printing the NAComputation.
|
|
28
|
+
/// To maintain the uniqueness of zones, the name of the zone should be unique
|
|
29
|
+
/// for this zone.
|
|
30
|
+
class Zone final {
|
|
31
|
+
public:
|
|
32
|
+
/// A simple struct to represent the extent of a zone.
|
|
33
|
+
struct Extent {
|
|
34
|
+
double minX = 0.0;
|
|
35
|
+
double minY = 0.0;
|
|
36
|
+
double maxX = 0.0;
|
|
37
|
+
double maxY = 0.0;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
private:
|
|
41
|
+
/// The identifier of the zone.
|
|
42
|
+
std::string name_;
|
|
43
|
+
/// The extent of the zone.
|
|
44
|
+
std::optional<Extent> extent_;
|
|
45
|
+
|
|
46
|
+
public:
|
|
47
|
+
/// Creates a new zone with the given name.
|
|
48
|
+
/// @param name The name of the zone.
|
|
49
|
+
explicit Zone(std::string name) : name_(std::move(name)) {}
|
|
50
|
+
|
|
51
|
+
/// Creates a new zone with the given name.
|
|
52
|
+
/// @param name The name of the zone.
|
|
53
|
+
/// @param extent The extent of the zone.
|
|
54
|
+
Zone(std::string name, const Extent& extent)
|
|
55
|
+
: name_(std::move(name)), extent_(extent) {}
|
|
56
|
+
|
|
57
|
+
/// Returns the name of the zone.
|
|
58
|
+
[[nodiscard]] auto getName() const -> std::string { return name_; }
|
|
59
|
+
|
|
60
|
+
/// Returns the extent of the zone.
|
|
61
|
+
[[nodiscard]] const std::optional<Extent>& getExtent() const {
|
|
62
|
+
return extent_;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/// Sets the extent of the zone.
|
|
66
|
+
void setExtent(const Extent& extent) { extent_ = extent; }
|
|
67
|
+
|
|
68
|
+
[[nodiscard]] auto contains(const Location& location) const -> bool;
|
|
69
|
+
|
|
70
|
+
/// Prints the zone to the given output stream.
|
|
71
|
+
/// @param os The output stream to print the zone to.
|
|
72
|
+
/// @param obj The zone to print.
|
|
73
|
+
/// @return The output stream after printing the zone.
|
|
74
|
+
friend auto operator<<(std::ostream& os, const Zone& obj) -> std::ostream& {
|
|
75
|
+
return os << obj.getName();
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/// Compares two zones for equality.
|
|
79
|
+
/// @param other The zone to compare with.
|
|
80
|
+
/// @return True if the zones are equal, false otherwise.
|
|
81
|
+
[[nodiscard]] auto operator==(const Zone& other) const -> bool {
|
|
82
|
+
if (this == &other) {
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
return name_ == other.name_;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/// Compares two zones for inequality.
|
|
89
|
+
/// @param other The zone to compare with.
|
|
90
|
+
/// @return True if the zones are not equal, false otherwise.
|
|
91
|
+
[[nodiscard]] auto operator!=(const Zone& other) const -> bool {
|
|
92
|
+
return !(*this == other);
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
} // namespace na
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
|
|
2
|
+
#ifndef MQT_CORE_NA_EXPORT_H
|
|
3
|
+
#define MQT_CORE_NA_EXPORT_H
|
|
4
|
+
|
|
5
|
+
#ifdef MQT_CORE_NA_STATIC_DEFINE
|
|
6
|
+
# define MQT_CORE_NA_EXPORT
|
|
7
|
+
# define MQT_CORE_NA_NO_EXPORT
|
|
8
|
+
#else
|
|
9
|
+
# ifndef MQT_CORE_NA_EXPORT
|
|
10
|
+
# ifdef mqt_core_na_EXPORTS
|
|
11
|
+
/* We are building this library */
|
|
12
|
+
# define MQT_CORE_NA_EXPORT __declspec(dllexport)
|
|
13
|
+
# else
|
|
14
|
+
/* We are using this library */
|
|
15
|
+
# define MQT_CORE_NA_EXPORT __declspec(dllimport)
|
|
16
|
+
# endif
|
|
17
|
+
# endif
|
|
18
|
+
|
|
19
|
+
# ifndef MQT_CORE_NA_NO_EXPORT
|
|
20
|
+
# define MQT_CORE_NA_NO_EXPORT
|
|
21
|
+
# endif
|
|
22
|
+
#endif
|
|
23
|
+
|
|
24
|
+
#ifndef MQT_CORE_NA_DEPRECATED
|
|
25
|
+
# define MQT_CORE_NA_DEPRECATED __declspec(deprecated)
|
|
26
|
+
#endif
|
|
27
|
+
|
|
28
|
+
#ifndef MQT_CORE_NA_DEPRECATED_EXPORT
|
|
29
|
+
# define MQT_CORE_NA_DEPRECATED_EXPORT MQT_CORE_NA_EXPORT MQT_CORE_NA_DEPRECATED
|
|
30
|
+
#endif
|
|
31
|
+
|
|
32
|
+
#ifndef MQT_CORE_NA_DEPRECATED_NO_EXPORT
|
|
33
|
+
# define MQT_CORE_NA_DEPRECATED_NO_EXPORT MQT_CORE_NA_NO_EXPORT MQT_CORE_NA_DEPRECATED
|
|
34
|
+
#endif
|
|
35
|
+
|
|
36
|
+
/* NOLINTNEXTLINE(readability-avoid-unconditional-preprocessor-if) */
|
|
37
|
+
#if 0 /* DEFINE_NO_DEPRECATED */
|
|
38
|
+
# ifndef MQT_CORE_NA_NO_DEPRECATED
|
|
39
|
+
# define MQT_CORE_NA_NO_DEPRECATED
|
|
40
|
+
# endif
|
|
41
|
+
#endif
|
|
42
|
+
|
|
43
|
+
#endif /* MQT_CORE_NA_EXPORT_H */
|