nwqlib 1.0.0__py3-none-any.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.
- nwqlib/__init__.py +63 -0
- nwqlib/__main__.py +5 -0
- nwqlib/_choice_archive.py +768 -0
- nwqlib/_counts.py +168 -0
- nwqlib/_limits.py +11 -0
- nwqlib/_linalg_laws.py +243 -0
- nwqlib/_numerics.py +288 -0
- nwqlib/_optional.py +13 -0
- nwqlib/_phase_product.py +119 -0
- nwqlib/_preparation_laws.py +93 -0
- nwqlib/_prepared_execution.py +5346 -0
- nwqlib/_projected_eigensolver.py +442 -0
- nwqlib/_qpy_archive.py +270 -0
- nwqlib/_quantum_readout.py +1071 -0
- nwqlib/_remote_preparation.py +200 -0
- nwqlib/_run_archive.py +1035 -0
- nwqlib/_run_journal.py +575 -0
- nwqlib/_sqlite_bytes.py +8 -0
- nwqlib/_validation.py +477 -0
- nwqlib/algorithms/__init__.py +68 -0
- nwqlib/algorithms/_eigen_inputs.py +494 -0
- nwqlib/algorithms/_eigen_support.py +178 -0
- nwqlib/algorithms/authoring.py +175 -0
- nwqlib/algorithms/expectation.py +2938 -0
- nwqlib/algorithms/expectation_metadata.py +37 -0
- nwqlib/algorithms/gcim/__init__.py +39 -0
- nwqlib/algorithms/gcim/adapt.py +1315 -0
- nwqlib/algorithms/gcim/adapt_acquisition.py +2547 -0
- nwqlib/algorithms/gcim/adapt_actions.py +264 -0
- nwqlib/algorithms/gcim/adapt_archive.py +349 -0
- nwqlib/algorithms/gcim/adapt_inputs.py +1049 -0
- nwqlib/algorithms/gcim/adapt_records.py +643 -0
- nwqlib/algorithms/gcim/adapt_verification.py +749 -0
- nwqlib/algorithms/gcim/chemistry.py +793 -0
- nwqlib/algorithms/gcim/fixed_basis.py +2447 -0
- nwqlib/algorithms/gcim/optimization.py +452 -0
- nwqlib/algorithms/gcim/pair_reducer.py +336 -0
- nwqlib/algorithms/gcim/pencil.py +229 -0
- nwqlib/algorithms/gcim/sector.py +132 -0
- nwqlib/algorithms/lanczos/__init__.py +12 -0
- nwqlib/algorithms/lanczos/archive.py +78 -0
- nwqlib/algorithms/lanczos/method.py +1217 -0
- nwqlib/algorithms/lanczos/numerical.py +908 -0
- nwqlib/algorithms/lanczos/readout.py +490 -0
- nwqlib/algorithms/lanczos/records.py +339 -0
- nwqlib/algorithms/lanczos/workflow.py +285 -0
- nwqlib/algorithms/lchs/__init__.py +27 -0
- nwqlib/algorithms/lchs/analysis.py +330 -0
- nwqlib/algorithms/lchs/archive.py +274 -0
- nwqlib/algorithms/lchs/compiled_selection.py +766 -0
- nwqlib/algorithms/lchs/host.py +689 -0
- nwqlib/algorithms/lchs/host_pf.py +424 -0
- nwqlib/algorithms/lchs/inhomogeneous_theory.py +240 -0
- nwqlib/algorithms/lchs/method.py +318 -0
- nwqlib/algorithms/lchs/native.py +715 -0
- nwqlib/algorithms/lchs/parameters.py +552 -0
- nwqlib/algorithms/lchs/periodic.py +476 -0
- nwqlib/algorithms/lchs/primary_records.py +415 -0
- nwqlib/algorithms/lchs/provider_config.py +80 -0
- nwqlib/algorithms/lchs/providers.py +1649 -0
- nwqlib/algorithms/lchs/quantum.py +403 -0
- nwqlib/algorithms/lchs/quantum_resources.py +516 -0
- nwqlib/algorithms/lchs/references.py +188 -0
- nwqlib/algorithms/lchs/refinement.py +344 -0
- nwqlib/algorithms/lchs/select_synthesis.py +531 -0
- nwqlib/algorithms/lchs/selected_grid.py +586 -0
- nwqlib/algorithms/lchs/selection.py +182 -0
- nwqlib/algorithms/lchs/solution_error_budget.py +583 -0
- nwqlib/algorithms/lchs/source_selection.py +135 -0
- nwqlib/algorithms/lchs/time_independent_common.py +39 -0
- nwqlib/algorithms/lchs/time_independent_terms.py +2694 -0
- nwqlib/algorithms/lchs/verification.py +396 -0
- nwqlib/algorithms/protocol.py +152 -0
- nwqlib/algorithms/qhd/__init__.py +44 -0
- nwqlib/algorithms/qhd/_durable.py +535 -0
- nwqlib/algorithms/qhd/_outer.py +453 -0
- nwqlib/algorithms/qhd/archive.py +255 -0
- nwqlib/algorithms/qhd/binary.py +1729 -0
- nwqlib/algorithms/qhd/circuit_errors.py +677 -0
- nwqlib/algorithms/qhd/compiler.py +699 -0
- nwqlib/algorithms/qhd/constrained.py +3654 -0
- nwqlib/algorithms/qhd/constrained_records.py +1483 -0
- nwqlib/algorithms/qhd/decoding.py +262 -0
- nwqlib/algorithms/qhd/evolution_bounds.py +696 -0
- nwqlib/algorithms/qhd/grid.py +286 -0
- nwqlib/algorithms/qhd/initial_state.py +914 -0
- nwqlib/algorithms/qhd/kinetic.py +170 -0
- nwqlib/algorithms/qhd/method.py +4577 -0
- nwqlib/algorithms/qhd/native.py +285 -0
- nwqlib/algorithms/qhd/objective.py +184 -0
- nwqlib/algorithms/qhd/potential.py +281 -0
- nwqlib/algorithms/qhd/records.py +1318 -0
- nwqlib/algorithms/qhd/refinement.py +2908 -0
- nwqlib/algorithms/qhd/refinement_records.py +1238 -0
- nwqlib/algorithms/qhd/resources.py +1627 -0
- nwqlib/algorithms/qhd/schedules.py +792 -0
- nwqlib/algorithms/qhd/split_step.py +807 -0
- nwqlib/algorithms/qhd/theory.py +733 -0
- nwqlib/algorithms/qhd/validation.py +209 -0
- nwqlib/algorithms/qhd/verification.py +553 -0
- nwqlib/algorithms/qls/__init__.py +18 -0
- nwqlib/algorithms/qls/archive.py +303 -0
- nwqlib/algorithms/qls/constants.py +49 -0
- nwqlib/algorithms/qls/host_planning.py +986 -0
- nwqlib/algorithms/qls/method.py +862 -0
- nwqlib/algorithms/qls/norm_search.py +443 -0
- nwqlib/algorithms/qls/numerical.py +264 -0
- nwqlib/algorithms/qls/periodic.py +123 -0
- nwqlib/algorithms/qls/primary_records.py +763 -0
- nwqlib/algorithms/qls/quantum.py +2019 -0
- nwqlib/algorithms/qls/verification.py +628 -0
- nwqlib/algorithms/qpe/__init__.py +13 -0
- nwqlib/algorithms/qpe/archive.py +174 -0
- nwqlib/algorithms/qpe/controller.py +334 -0
- nwqlib/algorithms/qpe/method.py +2165 -0
- nwqlib/algorithms/qpe/numerical.py +919 -0
- nwqlib/algorithms/qpe/powers.py +1449 -0
- nwqlib/algorithms/qpe/records.py +1623 -0
- nwqlib/algorithms/qpe/verification.py +346 -0
- nwqlib/algorithms/registry.py +187 -0
- nwqlib/amplitudes.py +257 -0
- nwqlib/artifacts.py +680 -0
- nwqlib/backends/__init__.py +59 -0
- nwqlib/backends/_auxiliary_process.py +167 -0
- nwqlib/backends/_native/nwqsim_runner.cpp +828 -0
- nwqlib/backends/_qpy_buffer.py +17 -0
- nwqlib/backends/assessment.py +2057 -0
- nwqlib/backends/capabilities.py +203 -0
- nwqlib/backends/connection.py +506 -0
- nwqlib/backends/host.py +11 -0
- nwqlib/backends/ibm_runtime.py +743 -0
- nwqlib/backends/inspection.py +235 -0
- nwqlib/backends/ionq.py +578 -0
- nwqlib/backends/nexus.py +635 -0
- nwqlib/backends/nwqec.py +469 -0
- nwqlib/backends/nwqsim.py +1166 -0
- nwqlib/backends/profiles.py +300 -0
- nwqlib/backends/qiskit_aer.py +1074 -0
- nwqlib/backends/qre.py +354 -0
- nwqlib/backends/resources.py +119 -0
- nwqlib/backends/results.py +90 -0
- nwqlib/backends/slurm.py +660 -0
- nwqlib/backends/targets.py +26 -0
- nwqlib/backends/telemetry.py +407 -0
- nwqlib/blocks/__init__.py +18 -0
- nwqlib/blocks/_archive.py +156 -0
- nwqlib/blocks/_qiskit_intake.py +321 -0
- nwqlib/blocks/encoding.py +215 -0
- nwqlib/blocks/kernels.py +131 -0
- nwqlib/blocks/lowering.py +407 -0
- nwqlib/blocks/records.py +354 -0
- nwqlib/blocks/selection.py +759 -0
- nwqlib/cli.py +142 -0
- nwqlib/core/__init__.py +11 -0
- nwqlib/core/analysis.py +356 -0
- nwqlib/core/planning.py +1588 -0
- nwqlib/core/records.py +553 -0
- nwqlib/evidence/__init__.py +54 -0
- nwqlib/evidence/_work.py +145 -0
- nwqlib/evidence/binary.py +563 -0
- nwqlib/evidence/energy_shift.py +601 -0
- nwqlib/evidence/error_model.py +886 -0
- nwqlib/evidence/records.py +125 -0
- nwqlib/evidence/scalar_bound.py +198 -0
- nwqlib/evidence/sector.py +118 -0
- nwqlib/evidence/statistics.py +226 -0
- nwqlib/evidence/verification.py +226 -0
- nwqlib/execution.py +1921 -0
- nwqlib/io/__init__.py +10 -0
- nwqlib/io/materialization.py +103 -0
- nwqlib/io/qasm.py +88 -0
- nwqlib/io/streaming.py +504 -0
- nwqlib/ir/__init__.py +19 -0
- nwqlib/ir/expressions.py +182 -0
- nwqlib/ir/records.py +434 -0
- nwqlib/ir/selection.py +111 -0
- nwqlib/ir/validation.py +972 -0
- nwqlib/operators/__init__.py +32 -0
- nwqlib/operators/_factorized.py +219 -0
- nwqlib/operators/_fermion.py +305 -0
- nwqlib/operators/_pauli.py +697 -0
- nwqlib/operators/access.py +114 -0
- nwqlib/operators/df.py +412 -0
- nwqlib/operators/inputs.py +698 -0
- nwqlib/operators/refinement.py +375 -0
- nwqlib/problems/__init__.py +29 -0
- nwqlib/problems/inputs.py +524 -0
- nwqlib/problems/records.py +780 -0
- nwqlib/problems/scalars.py +127 -0
- nwqlib/py.typed +1 -0
- nwqlib/reporting/__init__.py +5 -0
- nwqlib/reporting/records.py +21 -0
- nwqlib/resources/__init__.py +17 -0
- nwqlib/resources/fold.py +1065 -0
- nwqlib/resources/records.py +416 -0
- nwqlib/saved_evidence.py +418 -0
- nwqlib/scientist.py +637 -0
- nwqlib/search.py +705 -0
- nwqlib/serialization.py +54 -0
- nwqlib/subroutines/__init__.py +1 -0
- nwqlib/subroutines/_dense_synthesis.py +1422 -0
- nwqlib/subroutines/_matrix_checks.py +30 -0
- nwqlib/subroutines/_mcx_counts.py +36 -0
- nwqlib/subroutines/_multiplexors.py +827 -0
- nwqlib/subroutines/_power_of_two.py +25 -0
- nwqlib/subroutines/_registry_utils.py +70 -0
- nwqlib/subroutines/_semantic.py +124 -0
- nwqlib/subroutines/_serialization.py +37 -0
- nwqlib/subroutines/block_encoding/__init__.py +34 -0
- nwqlib/subroutines/block_encoding/banded.py +313 -0
- nwqlib/subroutines/block_encoding/core.py +1682 -0
- nwqlib/subroutines/block_encoding/registry.py +65 -0
- nwqlib/subroutines/dense_matrices.py +52 -0
- nwqlib/subroutines/fermionic_circuits.py +869 -0
- nwqlib/subroutines/fermionic_pool.py +1232 -0
- nwqlib/subroutines/hamiltonian_evolution/__init__.py +29 -0
- nwqlib/subroutines/hamiltonian_evolution/pauli_evolution.py +442 -0
- nwqlib/subroutines/hamiltonian_evolution/pauli_ir.py +89 -0
- nwqlib/subroutines/hamiltonian_evolution/pauli_labels.py +112 -0
- nwqlib/subroutines/hamiltonian_evolution/sparse_pauli_product.py +81 -0
- nwqlib/subroutines/lcu/__init__.py +26 -0
- nwqlib/subroutines/lcu/core.py +687 -0
- nwqlib/subroutines/lcu/data.py +106 -0
- nwqlib/subroutines/lcu/registry.py +41 -0
- nwqlib/subroutines/pauli_decomposition.py +241 -0
- nwqlib/subroutines/qiskit_compat.py +630 -0
- nwqlib/subroutines/qpe/__init__.py +15 -0
- nwqlib/subroutines/qpe/coherent.py +189 -0
- nwqlib/subroutines/qsp/__init__.py +42 -0
- nwqlib/subroutines/qsp/evolution.py +1566 -0
- nwqlib/subroutines/qsp/inverse.py +354 -0
- nwqlib/subroutines/qsp/phases.py +743 -0
- nwqlib/subroutines/qsp/shortcut.py +220 -0
- nwqlib/subroutines/state_preparation/__init__.py +41 -0
- nwqlib/subroutines/state_preparation/direct.py +163 -0
- nwqlib/subroutines/state_preparation/mps.py +451 -0
- nwqlib/subroutines/state_preparation/mps_circuit.py +450 -0
- nwqlib/subroutines/trotterization/__init__.py +32 -0
- nwqlib/subroutines/trotterization/error_budget.py +1967 -0
- nwqlib/subroutines/xacc.py +118 -0
- nwqlib-1.0.0.dist-info/METADATA +169 -0
- nwqlib-1.0.0.dist-info/RECORD +246 -0
- nwqlib-1.0.0.dist-info/WHEEL +5 -0
- nwqlib-1.0.0.dist-info/entry_points.txt +2 -0
- nwqlib-1.0.0.dist-info/licenses/LICENSE +24 -0
- nwqlib-1.0.0.dist-info/top_level.txt +1 -0
nwqlib/__init__.py
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"""NWQLib package root.
|
|
2
|
+
|
|
3
|
+
Root modules resolve lazily (PEP 562), so importing the root does not load
|
|
4
|
+
the whole library. ``__all__`` lists the current advertised entries; each
|
|
5
|
+
scientific owner defines its supported operations.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from importlib import import_module
|
|
9
|
+
from importlib.metadata import PackageNotFoundError, version
|
|
10
|
+
from typing import Any
|
|
11
|
+
|
|
12
|
+
try:
|
|
13
|
+
__version__ = version("nwqlib")
|
|
14
|
+
except PackageNotFoundError:
|
|
15
|
+
__version__ = "0.0.0"
|
|
16
|
+
|
|
17
|
+
_SCIENTIST_OPERATIONS = ("plan", "compare", "estimate", "prepare", "submit", "solve",
|
|
18
|
+
"load_result", "load_run", "methods")
|
|
19
|
+
_SEARCH_OPERATIONS = ("scan",)
|
|
20
|
+
_SCIENTIFIC_INPUTS = (
|
|
21
|
+
"Accuracy", "ConstrainedOptimization", "Eigenphase", "Eigenproblem", "Eigenvalue", "Expectation",
|
|
22
|
+
"LinearDynamics", "LinearSystem", "NormalizedExpectation", "NormSquared",
|
|
23
|
+
"Optimization", "OptimizationCandidate", "QuadraticForm", "Samples",
|
|
24
|
+
"Solution", "SpectralEstimation", "StateVector",
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
__all__ = [
|
|
28
|
+
"__version__",
|
|
29
|
+
"algorithms",
|
|
30
|
+
"backends",
|
|
31
|
+
"execution",
|
|
32
|
+
"reporting",
|
|
33
|
+
"subroutines",
|
|
34
|
+
*_SCIENTIST_OPERATIONS,
|
|
35
|
+
*_SEARCH_OPERATIONS,
|
|
36
|
+
*_SCIENTIFIC_INPUTS,
|
|
37
|
+
]
|
|
38
|
+
|
|
39
|
+
def __getattr__(name: str) -> Any:
|
|
40
|
+
"""Resolve a root name lazily (PEP 562), importing only its owner.
|
|
41
|
+
|
|
42
|
+
A missing first-level module becomes AttributeError. An ImportError raised
|
|
43
|
+
inside an existing module, such as a missing optional dependency, propagates
|
|
44
|
+
unchanged so it is not mistaken for a missing attribute.
|
|
45
|
+
"""
|
|
46
|
+
if name in _SCIENTIFIC_INPUTS:
|
|
47
|
+
return getattr(import_module("nwqlib.problems.records"), name)
|
|
48
|
+
if name in _SCIENTIST_OPERATIONS:
|
|
49
|
+
return getattr(import_module("nwqlib.scientist"), name)
|
|
50
|
+
if name in _SEARCH_OPERATIONS:
|
|
51
|
+
return getattr(import_module("nwqlib.search"), name)
|
|
52
|
+
try:
|
|
53
|
+
return import_module(f"nwqlib.{name}")
|
|
54
|
+
except ModuleNotFoundError as exc:
|
|
55
|
+
if exc.name == f"nwqlib.{name}":
|
|
56
|
+
raise AttributeError(
|
|
57
|
+
f"module 'nwqlib' has no attribute {name!r}"
|
|
58
|
+
) from None
|
|
59
|
+
raise
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def __dir__() -> list[str]:
|
|
63
|
+
return sorted(set(__all__) | set(globals()))
|