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,95 @@
|
|
|
1
|
+
// (C) Copyright John Maddock 2021.
|
|
2
|
+
// Use, modification and distribution are subject to the
|
|
3
|
+
// Boost Software License, Version 1.0. (See accompanying file
|
|
4
|
+
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
5
|
+
//
|
|
6
|
+
// We deliberately use assert in here:
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#ifndef BOOST_MP_DETAIL_FLOAT128_FUNCTIONS_HPP
|
|
10
|
+
#define BOOST_MP_DETAIL_FLOAT128_FUNCTIONS_HPP
|
|
11
|
+
|
|
12
|
+
#include <boost/multiprecision/detail/standalone_config.hpp>
|
|
13
|
+
|
|
14
|
+
#ifndef BOOST_MP_STANDALONE
|
|
15
|
+
#include <boost/cstdfloat.hpp>
|
|
16
|
+
#if defined(BOOST_MATH_USE_FLOAT128) && !defined(BOOST_CSTDFLOAT_NO_LIBQUADMATH_SUPPORT)
|
|
17
|
+
# define BOOST_MP_HAVE_CSTDFLOAT
|
|
18
|
+
#endif
|
|
19
|
+
#endif
|
|
20
|
+
|
|
21
|
+
#if defined(BOOST_HAS_FLOAT128)
|
|
22
|
+
|
|
23
|
+
namespace boost
|
|
24
|
+
{
|
|
25
|
+
namespace multiprecision
|
|
26
|
+
{
|
|
27
|
+
namespace float128_procs
|
|
28
|
+
{
|
|
29
|
+
extern "C" __float128 ldexpq(__float128, int) throw();
|
|
30
|
+
extern "C" __float128 frexpq(__float128, int*) throw();
|
|
31
|
+
extern "C" __float128 floorq(__float128) throw();
|
|
32
|
+
extern "C" __float128 nextafterq(__float128, __float128) throw();
|
|
33
|
+
extern "C" int isinfq(__float128) throw();
|
|
34
|
+
extern "C" int isnanq(__float128) throw();
|
|
35
|
+
extern "C" __float128 strtoflt128(const char*, char**) throw();
|
|
36
|
+
|
|
37
|
+
#ifdef BOOST_MP_HAVE_CSTDFLOAT
|
|
38
|
+
using std::ldexp;
|
|
39
|
+
using std::frexp;
|
|
40
|
+
using std::floor;
|
|
41
|
+
using std::nextafter;
|
|
42
|
+
#else
|
|
43
|
+
inline __float128 ldexp(__float128 f, int i) throw() { return ldexpq(f, i); }
|
|
44
|
+
inline __float128 frexp(__float128 f, int* p) throw() { return frexpq(f, p); }
|
|
45
|
+
inline __float128 floor(__float128 f) throw() { return floorq(f); }
|
|
46
|
+
inline __float128 nextafter(__float128 a, __float128 b) throw() { return nextafterq(a, b); }
|
|
47
|
+
#endif
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
namespace detail {
|
|
51
|
+
|
|
52
|
+
template <class T>
|
|
53
|
+
struct is_float128 : public std::is_same<__float128, T>
|
|
54
|
+
{};
|
|
55
|
+
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
namespace boost {
|
|
61
|
+
namespace math {
|
|
62
|
+
|
|
63
|
+
inline __float128 float_next(const __float128& f)
|
|
64
|
+
{
|
|
65
|
+
return boost::multiprecision::float128_procs::nextafterq(f, 2 * f);
|
|
66
|
+
}
|
|
67
|
+
inline int (isinf)(const __float128& f)
|
|
68
|
+
{
|
|
69
|
+
return boost::multiprecision::float128_procs::isinfq(f);
|
|
70
|
+
}
|
|
71
|
+
inline int (isnan)(const __float128& f)
|
|
72
|
+
{
|
|
73
|
+
return boost::multiprecision::float128_procs::isnanq(f);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
}}
|
|
77
|
+
|
|
78
|
+
#define BOOST_MP_FLOAT128_USING using boost::multiprecision::float128_procs::ldexp; using boost::multiprecision::float128_procs::frexp; using boost::multiprecision::float128_procs::floor; using boost::multiprecision::float128_procs::nextafter; using boost::math::isinf; using boost::math::isnan;
|
|
79
|
+
|
|
80
|
+
#else
|
|
81
|
+
#define BOOST_MP_FLOAT128_USING
|
|
82
|
+
|
|
83
|
+
namespace boost {
|
|
84
|
+
namespace multiprecision {
|
|
85
|
+
namespace detail {
|
|
86
|
+
|
|
87
|
+
template <class T>
|
|
88
|
+
struct is_float128 : public std::false_type
|
|
89
|
+
{};
|
|
90
|
+
|
|
91
|
+
}}} // namespace boost::multiprecision::detail
|
|
92
|
+
|
|
93
|
+
#endif
|
|
94
|
+
|
|
95
|
+
#endif // BOOST_MP_DETAIL_FLOAT128_FUNCTIONS_HPP
|
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
///////////////////////////////////////////////////////////////
|
|
2
|
+
// Copyright 2013 John Maddock. Distributed under the Boost
|
|
3
|
+
// Software License, Version 1.0. (See accompanying file
|
|
4
|
+
// LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt
|
|
5
|
+
//
|
|
6
|
+
// Generic routines for converting floating point values to and from decimal strings.
|
|
7
|
+
// Note that these use "naive" algorithms which result in rounding error - so they
|
|
8
|
+
// do not round trip to and from the string representation (but should only be out
|
|
9
|
+
// in the last bit).
|
|
10
|
+
//
|
|
11
|
+
|
|
12
|
+
#ifndef BOOST_MP_FLOAT_STRING_CVT_HPP
|
|
13
|
+
#define BOOST_MP_FLOAT_STRING_CVT_HPP
|
|
14
|
+
|
|
15
|
+
#include <string>
|
|
16
|
+
#include <cctype>
|
|
17
|
+
#include <boost/multiprecision/detail/no_exceptions_support.hpp>
|
|
18
|
+
#include <boost/multiprecision/detail/assert.hpp>
|
|
19
|
+
|
|
20
|
+
namespace boost { namespace multiprecision { namespace detail {
|
|
21
|
+
|
|
22
|
+
template <class I>
|
|
23
|
+
inline void round_string_up_at(std::string& s, std::ptrdiff_t pos, I& expon)
|
|
24
|
+
{
|
|
25
|
+
//
|
|
26
|
+
// Rounds up a string representation of a number at pos:
|
|
27
|
+
//
|
|
28
|
+
if (pos < 0)
|
|
29
|
+
{
|
|
30
|
+
s.insert(static_cast<std::string::size_type>(0), 1, '1');
|
|
31
|
+
s.erase(s.size() - 1);
|
|
32
|
+
++expon;
|
|
33
|
+
}
|
|
34
|
+
else if (s[static_cast<std::size_t>(pos)] == '9')
|
|
35
|
+
{
|
|
36
|
+
s[static_cast<std::size_t>(pos)] = '0';
|
|
37
|
+
round_string_up_at(s, pos - 1, expon);
|
|
38
|
+
}
|
|
39
|
+
else
|
|
40
|
+
{
|
|
41
|
+
if ((pos == 0) && (s[static_cast<std::size_t>(pos)] == '0') && (s.size() == 1))
|
|
42
|
+
++expon;
|
|
43
|
+
++s[static_cast<std::size_t>(pos)];
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
template <class Backend>
|
|
48
|
+
std::string convert_to_string(Backend b, std::streamsize digits, std::ios_base::fmtflags f)
|
|
49
|
+
{
|
|
50
|
+
using default_ops::eval_convert_to;
|
|
51
|
+
using default_ops::eval_divide;
|
|
52
|
+
using default_ops::eval_floor;
|
|
53
|
+
using default_ops::eval_fpclassify;
|
|
54
|
+
using default_ops::eval_log10;
|
|
55
|
+
using default_ops::eval_multiply;
|
|
56
|
+
using default_ops::eval_pow;
|
|
57
|
+
using default_ops::eval_subtract;
|
|
58
|
+
|
|
59
|
+
using ui_type = typename std::tuple_element<0, typename Backend::unsigned_types>::type;
|
|
60
|
+
using exponent_type = typename Backend::exponent_type ;
|
|
61
|
+
|
|
62
|
+
std::string result;
|
|
63
|
+
bool iszero = false;
|
|
64
|
+
bool isneg = false;
|
|
65
|
+
exponent_type expon = 0;
|
|
66
|
+
std::streamsize org_digits = digits;
|
|
67
|
+
BOOST_MP_ASSERT(digits > 0);
|
|
68
|
+
|
|
69
|
+
int fpt = eval_fpclassify(b);
|
|
70
|
+
|
|
71
|
+
if (fpt == static_cast<int>(FP_ZERO))
|
|
72
|
+
{
|
|
73
|
+
result = "0";
|
|
74
|
+
iszero = true;
|
|
75
|
+
}
|
|
76
|
+
else if (fpt == static_cast<int>(FP_INFINITE))
|
|
77
|
+
{
|
|
78
|
+
if (b.compare(ui_type(0)) < 0)
|
|
79
|
+
return "-inf";
|
|
80
|
+
else
|
|
81
|
+
return ((f & std::ios_base::showpos) == std::ios_base::showpos) ? "+inf" : "inf";
|
|
82
|
+
}
|
|
83
|
+
else if (fpt == static_cast<int>(FP_NAN))
|
|
84
|
+
{
|
|
85
|
+
return "nan";
|
|
86
|
+
}
|
|
87
|
+
else
|
|
88
|
+
{
|
|
89
|
+
//
|
|
90
|
+
// Start by figuring out the exponent:
|
|
91
|
+
//
|
|
92
|
+
isneg = b.compare(ui_type(0)) < 0;
|
|
93
|
+
if (isneg)
|
|
94
|
+
b.negate();
|
|
95
|
+
Backend t;
|
|
96
|
+
Backend ten;
|
|
97
|
+
ten = ui_type(10);
|
|
98
|
+
|
|
99
|
+
eval_log10(t, b);
|
|
100
|
+
eval_floor(t, t);
|
|
101
|
+
eval_convert_to(&expon, t);
|
|
102
|
+
if (-expon > std::numeric_limits<number<Backend> >::max_exponent10 - 3)
|
|
103
|
+
{
|
|
104
|
+
int e = -expon / 2;
|
|
105
|
+
Backend t2;
|
|
106
|
+
eval_pow(t2, ten, e);
|
|
107
|
+
eval_multiply(t, t2, b);
|
|
108
|
+
eval_multiply(t, t2);
|
|
109
|
+
if (expon & 1)
|
|
110
|
+
eval_multiply(t, ten);
|
|
111
|
+
}
|
|
112
|
+
else
|
|
113
|
+
{
|
|
114
|
+
eval_pow(t, ten, -expon);
|
|
115
|
+
eval_multiply(t, b);
|
|
116
|
+
}
|
|
117
|
+
//
|
|
118
|
+
// Make sure we're between [1,10) and adjust if not:
|
|
119
|
+
//
|
|
120
|
+
if (t.compare(ui_type(1)) < 0)
|
|
121
|
+
{
|
|
122
|
+
eval_multiply(t, ui_type(10));
|
|
123
|
+
--expon;
|
|
124
|
+
}
|
|
125
|
+
else if (t.compare(ui_type(10)) >= 0)
|
|
126
|
+
{
|
|
127
|
+
eval_divide(t, ui_type(10));
|
|
128
|
+
++expon;
|
|
129
|
+
}
|
|
130
|
+
Backend digit;
|
|
131
|
+
ui_type cdigit;
|
|
132
|
+
//
|
|
133
|
+
// Adjust the number of digits required based on formatting options:
|
|
134
|
+
//
|
|
135
|
+
if (((f & std::ios_base::fixed) == std::ios_base::fixed) && (expon != -1))
|
|
136
|
+
digits += expon + 1;
|
|
137
|
+
if ((f & std::ios_base::scientific) == std::ios_base::scientific)
|
|
138
|
+
++digits;
|
|
139
|
+
//
|
|
140
|
+
// Extract the digits one at a time:
|
|
141
|
+
//
|
|
142
|
+
for (unsigned i = 0; i < digits; ++i)
|
|
143
|
+
{
|
|
144
|
+
eval_floor(digit, t);
|
|
145
|
+
eval_convert_to(&cdigit, digit);
|
|
146
|
+
result += static_cast<char>('0' + cdigit);
|
|
147
|
+
eval_subtract(t, digit);
|
|
148
|
+
eval_multiply(t, ten);
|
|
149
|
+
}
|
|
150
|
+
//
|
|
151
|
+
// Possibly round result:
|
|
152
|
+
//
|
|
153
|
+
if (digits >= 0)
|
|
154
|
+
{
|
|
155
|
+
eval_floor(digit, t);
|
|
156
|
+
eval_convert_to(&cdigit, digit);
|
|
157
|
+
eval_subtract(t, digit);
|
|
158
|
+
if ((cdigit == 5) && (t.compare(ui_type(0)) == 0))
|
|
159
|
+
{
|
|
160
|
+
// Bankers rounding:
|
|
161
|
+
if ((*result.rbegin() - '0') & 1)
|
|
162
|
+
{
|
|
163
|
+
round_string_up_at(result, static_cast<std::ptrdiff_t>(result.size() - 1u), expon);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
else if (cdigit >= 5)
|
|
167
|
+
{
|
|
168
|
+
round_string_up_at(result, static_cast<std::ptrdiff_t>(result.size() - 1u), expon);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
eval_floor(t, b);
|
|
172
|
+
if ((t.compare(b) == 0) && (static_cast<std::size_t>(expon + 1) < result.size()))
|
|
173
|
+
{
|
|
174
|
+
// Input is an integer, sometimes we get a result which is not an integer here as a result of printing too
|
|
175
|
+
// many digits, so lets round if required:
|
|
176
|
+
round_string_up_at(result, expon + 1, expon);
|
|
177
|
+
result.erase(static_cast<std::string::size_type>(expon + 1));
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
while ((static_cast<std::streamsize>(result.size()) > digits) && (result.size() != 0U))
|
|
181
|
+
{
|
|
182
|
+
// We may get here as a result of rounding...
|
|
183
|
+
if (result.size() > 1)
|
|
184
|
+
result.erase(result.size() - 1);
|
|
185
|
+
else
|
|
186
|
+
{
|
|
187
|
+
if (expon > 0)
|
|
188
|
+
--expon; // so we put less padding in the result.
|
|
189
|
+
else
|
|
190
|
+
++expon;
|
|
191
|
+
++digits;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
BOOST_MP_ASSERT(org_digits >= 0);
|
|
195
|
+
if (isneg)
|
|
196
|
+
result.insert(static_cast<std::string::size_type>(0), 1, '-');
|
|
197
|
+
format_float_string(result, expon, org_digits, f, iszero);
|
|
198
|
+
|
|
199
|
+
return result;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
template <class Backend>
|
|
203
|
+
void convert_from_string(Backend& b, const char* p)
|
|
204
|
+
{
|
|
205
|
+
using default_ops::eval_add;
|
|
206
|
+
using default_ops::eval_divide;
|
|
207
|
+
using default_ops::eval_multiply;
|
|
208
|
+
using default_ops::eval_pow;
|
|
209
|
+
|
|
210
|
+
using ui_type = typename std::tuple_element<0, typename Backend::unsigned_types>::type;
|
|
211
|
+
b = ui_type(0);
|
|
212
|
+
if (!p || (*p == 0))
|
|
213
|
+
return;
|
|
214
|
+
|
|
215
|
+
bool is_neg = false;
|
|
216
|
+
bool is_neg_expon = false;
|
|
217
|
+
constexpr ui_type ten = ui_type(10);
|
|
218
|
+
typename Backend::exponent_type expon = 0;
|
|
219
|
+
int digits_seen = 0;
|
|
220
|
+
|
|
221
|
+
using limits = std::numeric_limits<number<Backend, et_off>>;
|
|
222
|
+
|
|
223
|
+
constexpr int max_digits = limits::is_specialized ? limits::max_digits10 + 1 : INT_MAX;
|
|
224
|
+
|
|
225
|
+
if (*p == '+')
|
|
226
|
+
++p;
|
|
227
|
+
else if (*p == '-')
|
|
228
|
+
{
|
|
229
|
+
is_neg = true;
|
|
230
|
+
++p;
|
|
231
|
+
}
|
|
232
|
+
if ((std::strcmp(p, "nan") == 0) || (std::strcmp(p, "NaN") == 0) || (std::strcmp(p, "NAN") == 0))
|
|
233
|
+
{
|
|
234
|
+
eval_divide(b, ui_type(0));
|
|
235
|
+
if (is_neg)
|
|
236
|
+
b.negate();
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
if ((std::strcmp(p, "inf") == 0) || (std::strcmp(p, "Inf") == 0) || (std::strcmp(p, "INF") == 0))
|
|
240
|
+
{
|
|
241
|
+
b = ui_type(1);
|
|
242
|
+
eval_divide(b, ui_type(0));
|
|
243
|
+
if (is_neg)
|
|
244
|
+
b.negate();
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
//
|
|
248
|
+
// Grab all the leading digits before the decimal point:
|
|
249
|
+
//
|
|
250
|
+
while (std::isdigit(*p))
|
|
251
|
+
{
|
|
252
|
+
eval_multiply(b, ten);
|
|
253
|
+
eval_add(b, ui_type(*p - '0'));
|
|
254
|
+
++p;
|
|
255
|
+
++digits_seen;
|
|
256
|
+
}
|
|
257
|
+
if (*p == '.')
|
|
258
|
+
{
|
|
259
|
+
//
|
|
260
|
+
// Grab everything after the point, stop when we've seen
|
|
261
|
+
// enough digits, even if there are actually more available:
|
|
262
|
+
//
|
|
263
|
+
++p;
|
|
264
|
+
while (std::isdigit(*p))
|
|
265
|
+
{
|
|
266
|
+
eval_multiply(b, ten);
|
|
267
|
+
eval_add(b, ui_type(*p - '0'));
|
|
268
|
+
++p;
|
|
269
|
+
--expon;
|
|
270
|
+
if (++digits_seen > max_digits)
|
|
271
|
+
break;
|
|
272
|
+
}
|
|
273
|
+
while (std::isdigit(*p))
|
|
274
|
+
++p;
|
|
275
|
+
}
|
|
276
|
+
//
|
|
277
|
+
// Parse the exponent:
|
|
278
|
+
//
|
|
279
|
+
if ((*p == 'e') || (*p == 'E'))
|
|
280
|
+
{
|
|
281
|
+
++p;
|
|
282
|
+
if (*p == '+')
|
|
283
|
+
++p;
|
|
284
|
+
else if (*p == '-')
|
|
285
|
+
{
|
|
286
|
+
is_neg_expon = true;
|
|
287
|
+
++p;
|
|
288
|
+
}
|
|
289
|
+
typename Backend::exponent_type e2 = 0;
|
|
290
|
+
while (std::isdigit(*p))
|
|
291
|
+
{
|
|
292
|
+
e2 *= 10;
|
|
293
|
+
e2 += (*p - '0');
|
|
294
|
+
++p;
|
|
295
|
+
}
|
|
296
|
+
if (is_neg_expon)
|
|
297
|
+
e2 = -e2;
|
|
298
|
+
expon += e2;
|
|
299
|
+
}
|
|
300
|
+
if (expon)
|
|
301
|
+
{
|
|
302
|
+
// Scale by 10^expon, note that 10^expon can be
|
|
303
|
+
// outside the range of our number type, even though the
|
|
304
|
+
// result is within range, if that looks likely, then split
|
|
305
|
+
// the calculation in two:
|
|
306
|
+
Backend t;
|
|
307
|
+
t = ten;
|
|
308
|
+
if (expon > limits::min_exponent10 + 2)
|
|
309
|
+
{
|
|
310
|
+
eval_pow(t, t, expon);
|
|
311
|
+
eval_multiply(b, t);
|
|
312
|
+
}
|
|
313
|
+
else
|
|
314
|
+
{
|
|
315
|
+
eval_pow(t, t, expon + digits_seen + 1);
|
|
316
|
+
eval_multiply(b, t);
|
|
317
|
+
t = ten;
|
|
318
|
+
eval_pow(t, t, -digits_seen - 1);
|
|
319
|
+
eval_multiply(b, t);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
if (is_neg)
|
|
323
|
+
b.negate();
|
|
324
|
+
if (*p)
|
|
325
|
+
{
|
|
326
|
+
// Unexpected input in string:
|
|
327
|
+
BOOST_MP_THROW_EXCEPTION(std::runtime_error("Unexpected characters in string being interpreted as a float128."));
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
}}} // namespace boost::multiprecision::detail
|
|
332
|
+
|
|
333
|
+
#endif
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
2
|
+
// Copyright 2022 Matt Borland. Distributed under the Boost
|
|
3
|
+
// Software License, Version 1.0. (See accompanying file
|
|
4
|
+
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
5
|
+
|
|
6
|
+
#ifndef BOOST_MP_DETAIL_FPCLASSIFY_HPP
|
|
7
|
+
#define BOOST_MP_DETAIL_FPCLASSIFY_HPP
|
|
8
|
+
|
|
9
|
+
#include <cmath>
|
|
10
|
+
#include <limits>
|
|
11
|
+
#include <type_traits>
|
|
12
|
+
#include <boost/multiprecision/detail/standalone_config.hpp>
|
|
13
|
+
#include <boost/multiprecision/detail/float128_functions.hpp>
|
|
14
|
+
|
|
15
|
+
#ifdef BOOST_MP_MATH_AVAILABLE
|
|
16
|
+
#include <boost/math/special_functions/fpclassify.hpp>
|
|
17
|
+
|
|
18
|
+
#define BOOST_MP_ISNAN(x) (boost::math::isnan)(x)
|
|
19
|
+
#define BOOST_MP_ISINF(x) (boost::math::isinf)(x)
|
|
20
|
+
#define BOOST_MP_FPCLASSIFY(x) (boost::math::fpclassify)(x)
|
|
21
|
+
#define BOOST_MP_ISFINITE(x) (!(boost::math::isnan)(x) && !(boost::math::isinf)(x))
|
|
22
|
+
|
|
23
|
+
#else
|
|
24
|
+
|
|
25
|
+
namespace boost { namespace multiprecision { namespace detail {
|
|
26
|
+
|
|
27
|
+
template <typename T, typename std::enable_if<std::is_floating_point<T>::value
|
|
28
|
+
#ifdef BOOST_HAS_FLOAT128
|
|
29
|
+
|| std::is_same<T, float128_type>::value
|
|
30
|
+
#endif
|
|
31
|
+
, bool>::type = true>
|
|
32
|
+
inline bool isnan BOOST_PREVENT_MACRO_SUBSTITUTION (const T x)
|
|
33
|
+
{
|
|
34
|
+
BOOST_MP_FLOAT128_USING;
|
|
35
|
+
using std::isnan;
|
|
36
|
+
return static_cast<bool>((isnan)(x));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
template <typename T, typename std::enable_if<!std::is_floating_point<T>::value
|
|
40
|
+
#ifdef BOOST_HAS_FLOAT128
|
|
41
|
+
&& !std::is_same<T, float128_type>::value
|
|
42
|
+
#endif
|
|
43
|
+
, bool>::type = true>
|
|
44
|
+
inline bool isnan BOOST_PREVENT_MACRO_SUBSTITUTION (const T x)
|
|
45
|
+
{
|
|
46
|
+
return x != x;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
template <typename T, typename std::enable_if<std::is_floating_point<T>::value
|
|
50
|
+
#ifdef BOOST_HAS_FLOAT128
|
|
51
|
+
|| std::is_same<T, float128_type>::value
|
|
52
|
+
#endif
|
|
53
|
+
, bool>::type = true>
|
|
54
|
+
inline bool isinf BOOST_PREVENT_MACRO_SUBSTITUTION (const T x)
|
|
55
|
+
{
|
|
56
|
+
BOOST_MP_FLOAT128_USING;
|
|
57
|
+
using std::isinf;
|
|
58
|
+
return static_cast<bool>((isinf)(x));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
template <typename T, typename std::enable_if<!std::is_floating_point<T>::value
|
|
62
|
+
#ifdef BOOST_HAS_FLOAT128
|
|
63
|
+
&& !std::is_same<T, float128_type>::value
|
|
64
|
+
#endif
|
|
65
|
+
, bool>::type = true>
|
|
66
|
+
inline bool isinf BOOST_PREVENT_MACRO_SUBSTITUTION (const T x)
|
|
67
|
+
{
|
|
68
|
+
return x == std::numeric_limits<T>::infinity() || x == -std::numeric_limits<T>::infinity();
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
template <typename T, typename std::enable_if<std::is_floating_point<T>::value, bool>::type = true>
|
|
72
|
+
inline int fpclassify BOOST_PREVENT_MACRO_SUBSTITUTION (const T x)
|
|
73
|
+
{
|
|
74
|
+
using std::fpclassify;
|
|
75
|
+
return fpclassify(x);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
template <typename T, typename std::enable_if<!std::is_floating_point<T>::value, bool>::type = true>
|
|
79
|
+
inline int fpclassify BOOST_PREVENT_MACRO_SUBSTITUTION (const T x)
|
|
80
|
+
{
|
|
81
|
+
BOOST_MP_FLOAT128_USING;
|
|
82
|
+
using std::isnan;
|
|
83
|
+
using std::isinf;
|
|
84
|
+
using std::abs;
|
|
85
|
+
|
|
86
|
+
return (isnan)(x) ? FP_NAN :
|
|
87
|
+
(isinf)(x) ? FP_INFINITE :
|
|
88
|
+
abs(x) == T(0) ? FP_ZERO :
|
|
89
|
+
abs(x) > 0 && abs(x) < (std::numeric_limits<T>::min)() ? FP_SUBNORMAL : FP_NORMAL;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
}}} // Namespace boost::multiprecision::detail
|
|
93
|
+
|
|
94
|
+
#define BOOST_MP_ISNAN(x) (boost::multiprecision::detail::isnan)(x)
|
|
95
|
+
#define BOOST_MP_ISINF(x) (boost::multiprecision::detail::isinf)(x)
|
|
96
|
+
#define BOOST_MP_FPCLASSIFY(x) (boost::multiprecision::detail::fpclassify)(x)
|
|
97
|
+
#define BOOST_MP_ISFINITE(x) (!(boost::multiprecision::detail::isnan)(x) && !(boost::multiprecision::detail::isinf)(x))
|
|
98
|
+
|
|
99
|
+
#endif
|
|
100
|
+
|
|
101
|
+
#endif // BOOST_MP_DETAIL_FPCLASSIFY_HPP
|