mqt-core 3.2.0__cp314-cp314-win_amd64.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.cp314-win_amd64.pyd +0 -0
- mqt/core/dd.pyi +1018 -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 +991 -0
- mqt/core/ir/registers.pyi +91 -0
- mqt/core/ir/symbolic.pyi +177 -0
- mqt/core/ir.cp314-win_amd64.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.2.0.dist-info/DELVEWHEEL +2 -0
- mqt_core-3.2.0.dist-info/METADATA +169 -0
- mqt_core-3.2.0.dist-info/RECORD +343 -0
- mqt_core-3.2.0.dist-info/WHEEL +5 -0
- mqt_core-3.2.0.dist-info/entry_points.txt +4 -0
- mqt_core-3.2.0.dist-info/licenses/LICENSE.md +22 -0
- mqt_core.libs/msvcp140.dll +0 -0
|
@@ -0,0 +1,84 @@
|
|
|
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 "dd/statistics/Statistics.hpp"
|
|
14
|
+
#include "nlohmann/json_fwd.hpp"
|
|
15
|
+
|
|
16
|
+
#include <cstddef>
|
|
17
|
+
|
|
18
|
+
namespace dd {
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @brief A utility class for storing statistics of a memory manager
|
|
22
|
+
*/
|
|
23
|
+
struct MemoryManagerStatistics final : Statistics {
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @brief Construct a new Memory Manager Statistics object
|
|
27
|
+
* @param entrySize The size of a single entry
|
|
28
|
+
*/
|
|
29
|
+
explicit MemoryManagerStatistics(const std::size_t entrySize)
|
|
30
|
+
: entrySize_(entrySize) {}
|
|
31
|
+
|
|
32
|
+
/// The size of a single entry
|
|
33
|
+
std::size_t entrySize_;
|
|
34
|
+
|
|
35
|
+
[[nodiscard]] double entryMemoryMIB() const;
|
|
36
|
+
|
|
37
|
+
/// The number of allocations performed
|
|
38
|
+
std::size_t numAllocations = 0U;
|
|
39
|
+
/// The number of allocated entries
|
|
40
|
+
std::size_t numAllocated = 0U;
|
|
41
|
+
/// The number of entries currently in use
|
|
42
|
+
std::size_t numUsed = 0U;
|
|
43
|
+
/// The number of entries currently available for reuse
|
|
44
|
+
std::size_t numAvailableForReuse = 0U;
|
|
45
|
+
/// The peak number of entries in use
|
|
46
|
+
std::size_t peakNumUsed = 0U;
|
|
47
|
+
/// The peak number of entries available for reuse
|
|
48
|
+
std::size_t peakNumAvailableForReuse = 0U;
|
|
49
|
+
|
|
50
|
+
/// Get the number of available entries from memory chunks
|
|
51
|
+
[[nodiscard]] std::size_t getNumAvailableFromChunks() const noexcept;
|
|
52
|
+
|
|
53
|
+
/// Get the total number of available entries
|
|
54
|
+
[[nodiscard]] std::size_t getTotalNumAvailable() const noexcept;
|
|
55
|
+
|
|
56
|
+
/// Get an estimate for ratio of used memory
|
|
57
|
+
[[nodiscard]] double getUsageRatio() const noexcept;
|
|
58
|
+
|
|
59
|
+
/// Get an estimate of the total allocated memory in MiB
|
|
60
|
+
[[nodiscard]] double getAllocatedMemoryMiB() const noexcept;
|
|
61
|
+
|
|
62
|
+
/// Get an estimate of the total used memory in MiB
|
|
63
|
+
[[nodiscard]] double getUsedMemoryMiB() const noexcept;
|
|
64
|
+
|
|
65
|
+
/// Get an estimate for the peak used memory in MiB
|
|
66
|
+
[[nodiscard]] double getPeakUsedMemoryMiB() const noexcept;
|
|
67
|
+
|
|
68
|
+
/// Track newly used entries (from chunks)
|
|
69
|
+
void trackUsedEntries(std::size_t numEntries = 1U) noexcept;
|
|
70
|
+
|
|
71
|
+
/// Track reused entries (from available list)
|
|
72
|
+
void trackReusedEntries(std::size_t numEntries = 1U) noexcept;
|
|
73
|
+
|
|
74
|
+
/// Track a new available entry for reuse
|
|
75
|
+
void trackReturnedEntry() noexcept;
|
|
76
|
+
|
|
77
|
+
/// Reset all statistics (except for the peak values)
|
|
78
|
+
void reset() noexcept override;
|
|
79
|
+
|
|
80
|
+
/// Get a JSON representation of the statistics
|
|
81
|
+
[[nodiscard]] nlohmann::json json() const override;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
} // namespace dd
|
|
@@ -0,0 +1,55 @@
|
|
|
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 "dd/Package.hpp"
|
|
14
|
+
|
|
15
|
+
#include <iostream>
|
|
16
|
+
#include <nlohmann/json_fwd.hpp>
|
|
17
|
+
#include <string>
|
|
18
|
+
|
|
19
|
+
namespace dd {
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @brief Computes an estimate for the memory usage of active DDs.
|
|
23
|
+
* @details The estimate is based on the number of active entries which are
|
|
24
|
+
* computed by temporarily marking all nodes reachable from the current root
|
|
25
|
+
* set and subsequently counting them in the unique tables. It accounts for the
|
|
26
|
+
* memory used by DD nodes, DD edges, and real numbers.
|
|
27
|
+
* @param package The package instance
|
|
28
|
+
* @return The estimated memory usage in MiB
|
|
29
|
+
*/
|
|
30
|
+
[[nodiscard]] double computeActiveMemoryMiB(Package& package);
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @brief Computes an estimate for the peak memory usage of DDs.
|
|
34
|
+
* @details The estimate is based on the peak number of used entries in the
|
|
35
|
+
* respective memory managers. It accounts for the memory used by DD nodes, DD
|
|
36
|
+
* edges, and real numbers.
|
|
37
|
+
* @param package The package instance
|
|
38
|
+
* @return The estimated memory usage in MiB
|
|
39
|
+
*/
|
|
40
|
+
[[nodiscard]] double computePeakMemoryMiB(const Package& package);
|
|
41
|
+
|
|
42
|
+
[[nodiscard]] nlohmann::basic_json<>
|
|
43
|
+
getStatistics(Package& package, bool includeIndividualTables = false);
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @brief Get some key statistics about data structures used by the DD package
|
|
47
|
+
* @return A JSON representation of the statistics
|
|
48
|
+
*/
|
|
49
|
+
[[nodiscard]] nlohmann::basic_json<> getDataStructureStatistics();
|
|
50
|
+
|
|
51
|
+
[[nodiscard]] std::string getStatisticsString(Package& package);
|
|
52
|
+
|
|
53
|
+
void printStatistics(Package& package, std::ostream& os = std::cout);
|
|
54
|
+
|
|
55
|
+
} // namespace dd
|
|
@@ -0,0 +1,48 @@
|
|
|
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 "nlohmann/json_fwd.hpp"
|
|
14
|
+
|
|
15
|
+
#include <ostream>
|
|
16
|
+
#include <string>
|
|
17
|
+
|
|
18
|
+
namespace dd {
|
|
19
|
+
|
|
20
|
+
struct Statistics {
|
|
21
|
+
Statistics() = default;
|
|
22
|
+
Statistics(const Statistics&) = default;
|
|
23
|
+
Statistics(Statistics&&) = default;
|
|
24
|
+
Statistics& operator=(const Statistics&) = default;
|
|
25
|
+
Statistics& operator=(Statistics&&) = default;
|
|
26
|
+
virtual ~Statistics() = default;
|
|
27
|
+
|
|
28
|
+
/// Reset all statistics (except for peak values)
|
|
29
|
+
virtual void reset() noexcept {};
|
|
30
|
+
|
|
31
|
+
/// Get a JSON representation of the statistics
|
|
32
|
+
[[nodiscard]] virtual nlohmann::json json() const;
|
|
33
|
+
|
|
34
|
+
/// Get a pretty-printed string representation of the statistics
|
|
35
|
+
[[nodiscard]] virtual std::string toString() const;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* @brief Write a string representation to an output stream
|
|
39
|
+
* @param os The output stream
|
|
40
|
+
* @param stats The statistics
|
|
41
|
+
* @return The output stream
|
|
42
|
+
*/
|
|
43
|
+
friend std::ostream& operator<<(std::ostream& os, const Statistics& stats) {
|
|
44
|
+
return os << stats.toString();
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
} // namespace dd
|
|
@@ -0,0 +1,79 @@
|
|
|
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 "dd/statistics/Statistics.hpp"
|
|
14
|
+
|
|
15
|
+
#include <cstddef>
|
|
16
|
+
#include <nlohmann/json_fwd.hpp>
|
|
17
|
+
|
|
18
|
+
namespace dd {
|
|
19
|
+
|
|
20
|
+
/// A utility class for storing statistics of a table
|
|
21
|
+
struct TableStatistics : public Statistics {
|
|
22
|
+
/// The size of a single entry
|
|
23
|
+
std::size_t entrySize = 0U;
|
|
24
|
+
/// The number of buckets in the table
|
|
25
|
+
std::size_t numBuckets = 0U;
|
|
26
|
+
/// The number of entries in the table
|
|
27
|
+
std::size_t numEntries = 0U;
|
|
28
|
+
/// The peak number of entries in the table
|
|
29
|
+
std::size_t peakNumEntries = 0U;
|
|
30
|
+
|
|
31
|
+
/// The number of collisions
|
|
32
|
+
std::size_t collisions = 0U;
|
|
33
|
+
/// The number of successful lookups
|
|
34
|
+
std::size_t hits = 0U;
|
|
35
|
+
/// The number of lookups
|
|
36
|
+
std::size_t lookups = 0U;
|
|
37
|
+
/// The number of inserts
|
|
38
|
+
std::size_t inserts = 0U;
|
|
39
|
+
|
|
40
|
+
/// Track a new insert
|
|
41
|
+
void trackInsert() noexcept;
|
|
42
|
+
|
|
43
|
+
/// Reset all statistics (except for peak values)
|
|
44
|
+
void reset() noexcept override;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @brief Get the hit ratio of the table.
|
|
48
|
+
* @details The hit ratio is the ratio of lookups that were successful.
|
|
49
|
+
* @returns The hit ratio of the table.
|
|
50
|
+
*/
|
|
51
|
+
[[nodiscard]] double hitRatio() const noexcept;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* @brief Get the collision ratio of the table.
|
|
55
|
+
* @details A collision occurs when the hash function maps two different
|
|
56
|
+
* entries to the same bucket. The collision ratio is the ratio of lookups
|
|
57
|
+
* that resulted in a collision.
|
|
58
|
+
* @returns The collision ratio of the table.
|
|
59
|
+
*/
|
|
60
|
+
[[nodiscard]] double colRatio() const noexcept;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* @brief Get the load factor of the table.
|
|
64
|
+
* @details The load factor is the ratio of entries to buckets.
|
|
65
|
+
* @return The load factor of the table.
|
|
66
|
+
*/
|
|
67
|
+
[[nodiscard]] double loadFactor() const noexcept;
|
|
68
|
+
|
|
69
|
+
/// Convert the entry size to MiB
|
|
70
|
+
[[nodiscard]] double getEntrySizeMiB() const noexcept;
|
|
71
|
+
|
|
72
|
+
/// Get the amount of memory required for the table in MiB
|
|
73
|
+
[[nodiscard]] double getMemoryMiB() const noexcept;
|
|
74
|
+
|
|
75
|
+
/// Get a JSON representation of the statistics
|
|
76
|
+
[[nodiscard]] nlohmann::json json() const override;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
} // namespace dd
|
|
@@ -0,0 +1,31 @@
|
|
|
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 "dd/statistics/TableStatistics.hpp"
|
|
14
|
+
|
|
15
|
+
#include <cstddef>
|
|
16
|
+
#include <nlohmann/json_fwd.hpp>
|
|
17
|
+
|
|
18
|
+
namespace dd {
|
|
19
|
+
/// \brief A class for storing statistics of a unique table
|
|
20
|
+
struct UniqueTableStatistics : public TableStatistics {
|
|
21
|
+
/// The number of garbage collection runs
|
|
22
|
+
std::size_t gcRuns = 0U;
|
|
23
|
+
|
|
24
|
+
/// Reset all statistics (except for the peak values)
|
|
25
|
+
void reset() noexcept override;
|
|
26
|
+
|
|
27
|
+
/// Get a JSON representation of the statistics
|
|
28
|
+
[[nodiscard]] nlohmann::json json() const override;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
} // namespace dd
|
|
@@ -0,0 +1,108 @@
|
|
|
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 Common definitions used throughout the library.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
#pragma once
|
|
16
|
+
|
|
17
|
+
#include <cstddef>
|
|
18
|
+
#include <cstdint>
|
|
19
|
+
#include <vector>
|
|
20
|
+
|
|
21
|
+
namespace qc {
|
|
22
|
+
/**
|
|
23
|
+
* @brief Type alias for qubit indices.
|
|
24
|
+
* @details This type (alias) is used to represent qubit indices in the library.
|
|
25
|
+
* It has been chosen to be an unsigned 32-bit integer to allow for up to
|
|
26
|
+
* 4,294,967,295 qubits, which should be enough for most use cases.
|
|
27
|
+
*/
|
|
28
|
+
using Qubit = std::uint32_t;
|
|
29
|
+
/**
|
|
30
|
+
* @brief Type alias for classical bit indices.
|
|
31
|
+
* @details This type (alias) is used to represent classical bit indices in the
|
|
32
|
+
* library. The choice of 64-bits is arbitrary and can be changed if necessary.
|
|
33
|
+
*/
|
|
34
|
+
using Bit = std::uint64_t;
|
|
35
|
+
|
|
36
|
+
/// A type alias for a vector of qubits which are supposed to act as targets.
|
|
37
|
+
using Targets = std::vector<Qubit>;
|
|
38
|
+
|
|
39
|
+
/// Floating-point type used throughout the library
|
|
40
|
+
using fp = double;
|
|
41
|
+
|
|
42
|
+
/// A constant for the value of \f$\pi\f$.
|
|
43
|
+
static constexpr auto PI = static_cast<fp>(
|
|
44
|
+
3.141592653589793238462643383279502884197169399375105820974L);
|
|
45
|
+
/// A constant for the value of \f$\frac{\pi}{2}\f$.
|
|
46
|
+
static constexpr auto PI_2 = static_cast<fp>(
|
|
47
|
+
1.570796326794896619231321691639751442098584699687552910487L);
|
|
48
|
+
/// A constant for the value of \f$\frac{\pi}{4}\f$.
|
|
49
|
+
static constexpr auto PI_4 = static_cast<fp>(
|
|
50
|
+
0.785398163397448309615660845819875721049292349843776455243L);
|
|
51
|
+
/// A constant for the value of \f$\tau\f$.
|
|
52
|
+
static constexpr auto TAU = static_cast<fp>(
|
|
53
|
+
6.283185307179586476925286766559005768394338798750211641950L);
|
|
54
|
+
/// A constant for the value of \f$e\f$.
|
|
55
|
+
static constexpr auto E = static_cast<fp>(
|
|
56
|
+
2.718281828459045235360287471352662497757247093699959574967L);
|
|
57
|
+
|
|
58
|
+
/// Supported file formats
|
|
59
|
+
enum class Format : uint8_t {
|
|
60
|
+
/**
|
|
61
|
+
* @brief OpenQASM 2.0 format
|
|
62
|
+
* @see https://arxiv.org/abs/1707.03429
|
|
63
|
+
*/
|
|
64
|
+
OpenQASM2,
|
|
65
|
+
/**
|
|
66
|
+
* @brief OpenQASM 3 format
|
|
67
|
+
* @see https://openqasm.com/index.html
|
|
68
|
+
*/
|
|
69
|
+
OpenQASM3
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* @brief Combine two 64bit hashes into one 64bit hash
|
|
74
|
+
* @details Combines two 64bit hashes into one 64bit hash based on
|
|
75
|
+
* boost::hash_combine (https://www.boost.org/LICENSE_1_0.txt)
|
|
76
|
+
* @param lhs The first hash
|
|
77
|
+
* @param rhs The second hash
|
|
78
|
+
* @returns The combined hash
|
|
79
|
+
*/
|
|
80
|
+
[[nodiscard]] constexpr std::size_t
|
|
81
|
+
combineHash(const std::size_t lhs, const std::size_t rhs) noexcept {
|
|
82
|
+
return lhs ^ (rhs + 0x9e3779b97f4a7c15ULL + (lhs << 6) + (lhs >> 2));
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* @brief Extend a 64bit hash with a 64bit integer
|
|
87
|
+
* @param hash The hash to extend
|
|
88
|
+
* @param with The integer to extend the hash with
|
|
89
|
+
* @return The combined hash
|
|
90
|
+
*/
|
|
91
|
+
constexpr void hashCombine(std::size_t& hash, const std::size_t with) noexcept {
|
|
92
|
+
hash = combineHash(hash, with);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* @brief Function used to mark unreachable code
|
|
97
|
+
* @details Uses compiler specific extensions if possible. Even if no extension
|
|
98
|
+
* is used, undefined behavior is still raised by an empty function body and the
|
|
99
|
+
* noreturn attribute.
|
|
100
|
+
*/
|
|
101
|
+
[[noreturn]] inline void unreachable() {
|
|
102
|
+
#ifdef __GNUC__ // GCC, Clang, ICC
|
|
103
|
+
__builtin_unreachable();
|
|
104
|
+
#elif defined(_MSC_VER) // MSVC
|
|
105
|
+
__assume(false);
|
|
106
|
+
#endif
|
|
107
|
+
}
|
|
108
|
+
} // namespace qc
|
|
@@ -0,0 +1,213 @@
|
|
|
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 "Definitions.hpp"
|
|
14
|
+
#include "operations/Control.hpp"
|
|
15
|
+
|
|
16
|
+
#include <cstddef>
|
|
17
|
+
#include <functional>
|
|
18
|
+
#include <initializer_list>
|
|
19
|
+
#include <map>
|
|
20
|
+
#include <utility>
|
|
21
|
+
|
|
22
|
+
namespace qc {
|
|
23
|
+
class Permutation {
|
|
24
|
+
std::map<Qubit, Qubit> permutation;
|
|
25
|
+
|
|
26
|
+
public:
|
|
27
|
+
[[nodiscard]] auto apply(const Controls& controls) const -> Controls;
|
|
28
|
+
[[nodiscard]] auto apply(const Targets& targets) const -> Targets;
|
|
29
|
+
[[nodiscard]] auto apply(Qubit qubit) const -> Qubit;
|
|
30
|
+
[[nodiscard]] auto maxKey() const -> Qubit;
|
|
31
|
+
[[nodiscard]] auto maxValue() const -> Qubit;
|
|
32
|
+
|
|
33
|
+
/// Constructors
|
|
34
|
+
Permutation() = default;
|
|
35
|
+
template <class InputIt>
|
|
36
|
+
Permutation(InputIt first, InputIt last) : permutation(first, last) {}
|
|
37
|
+
Permutation(const std::initializer_list<std::pair<const Qubit, Qubit>> init)
|
|
38
|
+
: permutation(init) {}
|
|
39
|
+
|
|
40
|
+
/// Returns an iterator to the beginning
|
|
41
|
+
[[nodiscard]] auto begin() noexcept -> decltype(permutation)::iterator {
|
|
42
|
+
return permutation.begin();
|
|
43
|
+
}
|
|
44
|
+
[[nodiscard]] auto begin() const noexcept
|
|
45
|
+
-> decltype(permutation)::const_iterator {
|
|
46
|
+
return permutation.begin();
|
|
47
|
+
}
|
|
48
|
+
[[nodiscard]] auto cbegin() const noexcept -> auto {
|
|
49
|
+
return permutation.cbegin();
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/// Returns an iterator to the end
|
|
53
|
+
[[nodiscard]] auto end() noexcept -> decltype(permutation)::iterator {
|
|
54
|
+
return permutation.end();
|
|
55
|
+
}
|
|
56
|
+
[[nodiscard]] auto end() const noexcept
|
|
57
|
+
-> decltype(permutation)::const_iterator {
|
|
58
|
+
return permutation.end();
|
|
59
|
+
}
|
|
60
|
+
[[nodiscard]] auto cend() const noexcept -> auto {
|
|
61
|
+
return permutation.cend();
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/// Returns a reverse iterator to the beginning
|
|
65
|
+
[[nodiscard]] auto rbegin() noexcept
|
|
66
|
+
-> decltype(permutation)::reverse_iterator {
|
|
67
|
+
return permutation.rbegin();
|
|
68
|
+
}
|
|
69
|
+
[[nodiscard]] auto rbegin() const noexcept
|
|
70
|
+
-> decltype(permutation)::const_reverse_iterator {
|
|
71
|
+
return permutation.rbegin();
|
|
72
|
+
}
|
|
73
|
+
[[nodiscard]] auto crbegin() const noexcept -> auto {
|
|
74
|
+
return permutation.crbegin();
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/// Returns a reverse iterator to the end
|
|
78
|
+
[[nodiscard]] auto rend() noexcept
|
|
79
|
+
-> decltype(permutation)::reverse_iterator {
|
|
80
|
+
return permutation.rend();
|
|
81
|
+
}
|
|
82
|
+
[[nodiscard]] auto rend() const noexcept
|
|
83
|
+
-> decltype(permutation)::const_reverse_iterator {
|
|
84
|
+
return permutation.rend();
|
|
85
|
+
}
|
|
86
|
+
[[nodiscard]] auto crend() const noexcept -> auto {
|
|
87
|
+
return permutation.crend();
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/// Checks whether the permutation is empty
|
|
91
|
+
[[nodiscard]] auto empty() const -> bool { return permutation.empty(); }
|
|
92
|
+
|
|
93
|
+
/// Returns the number of elements
|
|
94
|
+
[[nodiscard]] auto size() const -> std::size_t { return permutation.size(); }
|
|
95
|
+
|
|
96
|
+
/// Clears the permutation
|
|
97
|
+
void clear() { permutation.clear(); }
|
|
98
|
+
|
|
99
|
+
/// Finds element with specific key
|
|
100
|
+
[[nodiscard]] auto find(const Qubit qubit)
|
|
101
|
+
-> decltype(permutation.find(qubit)) {
|
|
102
|
+
return permutation.find(qubit);
|
|
103
|
+
}
|
|
104
|
+
[[nodiscard]] auto find(const Qubit qubit) const
|
|
105
|
+
-> decltype(permutation.find(qubit)) {
|
|
106
|
+
return permutation.find(qubit);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/// Returns the number of elements with specific key
|
|
110
|
+
[[nodiscard]] auto count(const Qubit qubit) const -> std::size_t {
|
|
111
|
+
return permutation.count(qubit);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/// Access specified element with bounds checking
|
|
115
|
+
[[nodiscard]] auto at(const Qubit qubit) const -> Qubit {
|
|
116
|
+
return permutation.at(qubit);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/// Access specified element with bounds checking
|
|
120
|
+
[[nodiscard]] auto at(const Qubit qubit) -> Qubit& {
|
|
121
|
+
return permutation.at(qubit);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/// Access or insert specified element
|
|
125
|
+
[[nodiscard]] auto operator[](const Qubit qubit) -> Qubit& {
|
|
126
|
+
return permutation[qubit];
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/// Inserts elements or nodes
|
|
130
|
+
auto insert(const std::pair<const Qubit, Qubit>& value) -> auto {
|
|
131
|
+
return permutation.insert(value);
|
|
132
|
+
}
|
|
133
|
+
template <class InputIt> auto insert(InputIt first, InputIt last) -> void {
|
|
134
|
+
permutation.insert(first, last);
|
|
135
|
+
}
|
|
136
|
+
auto insert(const std::initializer_list<std::pair<const Qubit, Qubit>> init)
|
|
137
|
+
-> void {
|
|
138
|
+
permutation.insert(init);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/// Constructs element in-place
|
|
142
|
+
template <class... Args> auto emplace(Args&&... args) -> auto {
|
|
143
|
+
return permutation.emplace(std::forward<Args>(args)...);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// NOLINTBEGIN(readability-identifier-naming)
|
|
147
|
+
|
|
148
|
+
/// Inserts in-place if the key does not exist, does nothing otherwise
|
|
149
|
+
template <class... Args>
|
|
150
|
+
auto try_emplace(const Qubit key, Args&&... args) -> auto {
|
|
151
|
+
return permutation.try_emplace(key, std::forward<Args>(args)...);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/// Inserts an element or assigns to the current element if the key already
|
|
155
|
+
/// exists
|
|
156
|
+
auto insert_or_assign(const Qubit key, const Qubit value) -> auto {
|
|
157
|
+
return permutation.insert_or_assign(key, value);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// NOLINTEND(readability-identifier-naming)
|
|
161
|
+
|
|
162
|
+
/// Erases elements
|
|
163
|
+
auto erase(const Qubit qubit) -> std::size_t {
|
|
164
|
+
return permutation.erase(qubit);
|
|
165
|
+
}
|
|
166
|
+
auto erase(const decltype(permutation)::const_iterator pos)
|
|
167
|
+
-> decltype(permutation)::iterator {
|
|
168
|
+
return permutation.erase(pos);
|
|
169
|
+
}
|
|
170
|
+
auto erase(const decltype(permutation)::const_iterator first,
|
|
171
|
+
const decltype(permutation)::const_iterator last)
|
|
172
|
+
-> decltype(permutation)::iterator {
|
|
173
|
+
return permutation.erase(first, last);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/// Swaps the contents
|
|
177
|
+
void swap(Permutation& other) noexcept {
|
|
178
|
+
permutation.swap(other.permutation);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/// Lexicographically compares the values in the map
|
|
182
|
+
[[nodiscard]] auto operator<(const Permutation& other) const -> bool {
|
|
183
|
+
return permutation < other.permutation;
|
|
184
|
+
}
|
|
185
|
+
[[nodiscard]] auto operator<=(const Permutation& other) const -> bool {
|
|
186
|
+
return permutation <= other.permutation;
|
|
187
|
+
}
|
|
188
|
+
[[nodiscard]] auto operator>(const Permutation& other) const -> bool {
|
|
189
|
+
return permutation > other.permutation;
|
|
190
|
+
}
|
|
191
|
+
[[nodiscard]] auto operator>=(const Permutation& other) const -> bool {
|
|
192
|
+
return permutation >= other.permutation;
|
|
193
|
+
}
|
|
194
|
+
[[nodiscard]] auto operator==(const Permutation& other) const -> bool {
|
|
195
|
+
return permutation == other.permutation;
|
|
196
|
+
}
|
|
197
|
+
[[nodiscard]] auto operator!=(const Permutation& other) const -> bool {
|
|
198
|
+
return permutation != other.permutation;
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
} // namespace qc
|
|
202
|
+
|
|
203
|
+
// define hash function for Permutation
|
|
204
|
+
template <> struct std::hash<qc::Permutation> {
|
|
205
|
+
std::size_t operator()(const qc::Permutation& p) const noexcept {
|
|
206
|
+
std::size_t seed = 0;
|
|
207
|
+
for (const auto& [k, v] : p) {
|
|
208
|
+
qc::hashCombine(seed, k);
|
|
209
|
+
qc::hashCombine(seed, v);
|
|
210
|
+
}
|
|
211
|
+
return seed;
|
|
212
|
+
}
|
|
213
|
+
};
|