tequila-basic 1.9.9__tar.gz → 1.9.10__tar.gz
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.
- {tequila_basic-1.9.9/src/tequila_basic.egg-info → tequila_basic-1.9.10}/PKG-INFO +13 -16
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/README.md +12 -15
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/requirements.txt +2 -0
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/setup.py +20 -23
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/__init__.py +29 -14
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/apps/__init__.py +14 -5
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/apps/_unary_state_prep_impl.py +145 -112
- tequila_basic-1.9.10/src/tequila/apps/adapt/__init__.py +9 -0
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/apps/adapt/adapt.py +154 -113
- tequila_basic-1.9.10/src/tequila/apps/krylov/__init__.py +1 -0
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/apps/krylov/krylov.py +23 -21
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/apps/robustness/helpers.py +10 -6
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/apps/robustness/interval.py +238 -156
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/apps/unary_state_prep.py +29 -23
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/autograd_imports.py +8 -5
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/circuit/__init__.py +2 -1
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/circuit/_gates_impl.py +135 -67
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/circuit/circuit.py +163 -79
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/circuit/compiler.py +114 -105
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/circuit/gates.py +288 -120
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/circuit/gradient.py +35 -23
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/circuit/noise.py +83 -74
- tequila_basic-1.9.10/src/tequila/circuit/postselection.py +120 -0
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/circuit/pyzx.py +10 -6
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/circuit/qasm.py +201 -83
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/circuit/qpic.py +63 -61
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/grouping/binary_rep.py +148 -146
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/grouping/binary_utils.py +84 -75
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/grouping/compile_groups.py +334 -230
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/grouping/ev_utils.py +77 -41
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/grouping/fermionic_functions.py +383 -308
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/grouping/fermionic_methods.py +170 -123
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/grouping/overlapping_methods.py +69 -52
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/hamiltonian/paulis.py +12 -13
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/hamiltonian/paulistring.py +1 -1
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/hamiltonian/qubit_hamiltonian.py +45 -35
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/ml/__init__.py +1 -0
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/ml/interface_torch.py +19 -16
- tequila_basic-1.9.10/src/tequila/ml/ml_api.py +30 -0
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/ml/utils_ml.py +12 -11
- tequila_basic-1.9.10/src/tequila/objective/__init__.py +10 -0
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/objective/braket.py +55 -47
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/objective/objective.py +87 -55
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/objective/qtensor.py +36 -27
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/optimizers/__init__.py +31 -23
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/optimizers/_containers.py +11 -7
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/optimizers/optimizer_base.py +111 -83
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/optimizers/optimizer_gd.py +258 -231
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/optimizers/optimizer_gpyopt.py +56 -42
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/optimizers/optimizer_scipy.py +157 -112
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/quantumchemistry/__init__.py +66 -38
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/quantumchemistry/chemistry_tools.py +393 -209
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/quantumchemistry/encodings.py +121 -13
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/quantumchemistry/madness_interface.py +170 -96
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/quantumchemistry/orbital_optimizer.py +86 -41
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/quantumchemistry/psi4_interface.py +166 -97
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/quantumchemistry/pyscf_interface.py +70 -23
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/quantumchemistry/qc_base.py +866 -414
- tequila_basic-1.9.9/src/tequila_basic.egg-info/dependency_links.txt → tequila_basic-1.9.10/src/tequila/simulators/__init__.py +0 -0
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/simulators/simulator_api.py +247 -105
- tequila_basic-1.9.10/src/tequila/simulators/simulator_aqt.py +102 -0
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/simulators/simulator_base.py +147 -53
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/simulators/simulator_cirq.py +58 -42
- tequila_basic-1.9.10/src/tequila/simulators/simulator_cudaq.py +600 -0
- tequila_basic-1.9.10/src/tequila/simulators/simulator_ddsim.py +390 -0
- tequila_basic-1.9.10/src/tequila/simulators/simulator_mqp.py +30 -0
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/simulators/simulator_pyquil.py +190 -171
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/simulators/simulator_qibo.py +95 -87
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/simulators/simulator_qiskit.py +119 -107
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/simulators/simulator_qlm.py +52 -26
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/simulators/simulator_qulacs.py +74 -52
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/simulators/simulator_spex.py +95 -60
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/simulators/simulator_symbolic.py +6 -5
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/simulators/test_spex_simulator.py +8 -11
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/tools/convenience.py +4 -4
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/tools/qng.py +72 -64
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/tools/random_generators.py +38 -34
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/utils/bitstrings.py +7 -7
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/utils/exceptions.py +19 -5
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/utils/joined_transformation.py +8 -10
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/utils/keymap.py +0 -5
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/utils/misc.py +6 -4
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/version.py +1 -1
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/wavefunction/qubit_wavefunction.py +47 -28
- {tequila_basic-1.9.9 → tequila_basic-1.9.10/src/tequila_basic.egg-info}/PKG-INFO +13 -16
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila_basic.egg-info/SOURCES.txt +8 -0
- tequila_basic-1.9.10/src/tequila_basic.egg-info/dependency_links.txt +1 -0
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/tests/test_TrotErr.py +46 -42
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/tests/test_adapt.py +27 -24
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/tests/test_array.py +7 -3
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/tests/test_binary_pauli.py +93 -84
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/tests/test_binary_utils.py +26 -17
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/tests/test_bitstrings.py +32 -32
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/tests/test_braket.py +145 -148
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/tests/test_chemistry.py +440 -193
- tequila_basic-1.9.10/tests/test_chemistry_f12.py +84 -0
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/tests/test_chemistry_madness.py +107 -68
- tequila_basic-1.9.10/tests/test_circuit_unitary.py +122 -0
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/tests/test_circuits.py +185 -116
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/tests/test_fermionic_meas.py +54 -36
- tequila_basic-1.9.10/tests/test_gates.py +182 -0
- tequila_basic-1.9.10/tests/test_gd_optimizer.py +148 -0
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/tests/test_gpyopt.py +46 -29
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/tests/test_gradient.py +79 -62
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/tests/test_hamiltonian_arithmetic.py +126 -118
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/tests/test_krylov.py +12 -11
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/tests/test_mappings.py +29 -31
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/tests/test_noise.py +36 -34
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/tests/test_noise_opt.py +30 -22
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/tests/test_objectives.py +278 -200
- tequila_basic-1.9.10/tests/test_postselection.py +54 -0
- tequila_basic-1.9.10/tests/test_pyzx.py +212 -0
- tequila_basic-1.9.10/tests/test_qasm.py +264 -0
- tequila_basic-1.9.10/tests/test_qtensor.py +88 -0
- tequila_basic-1.9.10/tests/test_recompilation_routines.py +202 -0
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/tests/test_scipy.py +97 -56
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/tests/test_simulator_backends.py +138 -73
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/tests/test_symbolic_simulator.py +18 -14
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/tests/test_torch_interface.py +11 -11
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/tests/test_unary_state_prep.py +18 -10
- tequila_basic-1.9.10/tests/test_variable.py +100 -0
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/tests/test_zzz_cleanup.py +4 -2
- tequila_basic-1.9.9/src/tequila/apps/adapt/__init__.py +0 -1
- tequila_basic-1.9.9/src/tequila/apps/krylov/__init__.py +0 -1
- tequila_basic-1.9.9/src/tequila/ml/ml_api.py +0 -29
- tequila_basic-1.9.9/src/tequila/objective/__init__.py +0 -5
- tequila_basic-1.9.9/src/tequila/simulators/__init__.py +0 -4
- tequila_basic-1.9.9/tests/test_chemistry_f12.py +0 -56
- tequila_basic-1.9.9/tests/test_gd_optimizer.py +0 -98
- tequila_basic-1.9.9/tests/test_pyzx.py +0 -178
- tequila_basic-1.9.9/tests/test_qasm.py +0 -234
- tequila_basic-1.9.9/tests/test_qtensor.py +0 -80
- tequila_basic-1.9.9/tests/test_recompilation_routines.py +0 -160
- tequila_basic-1.9.9/tests/test_variable.py +0 -72
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/LICENSE +0 -0
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/MANIFEST.in +0 -0
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/setup.cfg +0 -0
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/apps/robustness/__init__.py +0 -0
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/grouping/__init__.py +0 -0
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/hamiltonian/__init__.py +0 -0
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/simulators/simulator_qiskit_gpu.py +0 -0
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/simulators/simulator_qulacs_gpu.py +0 -0
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/tools/__init__.py +0 -0
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/utils/__init__.py +0 -0
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila/wavefunction/__init__.py +0 -0
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila_basic.egg-info/requires.txt +0 -0
- {tequila_basic-1.9.9 → tequila_basic-1.9.10}/src/tequila_basic.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: tequila-basic
|
3
|
-
Version: 1.9.
|
3
|
+
Version: 1.9.10
|
4
4
|
Summary: A High-Level Abstraction Framework for Quantum Algorithms
|
5
5
|
Home-page: https://github.com/tequilahub/tequila
|
6
6
|
Author: Tequila Developers
|
@@ -36,7 +36,8 @@ Tequila can execute the underlying quantum expectation values on state of the ar
|
|
36
36
|
# Getting Started
|
37
37
|
|
38
38
|
Get started with our collection of
|
39
|
-
- *[Tutorials](https://tequilahub.github.io/tequila-tutorials/)*
|
39
|
+
- *[Tutorials](https://tequilahub.github.io/tequila-tutorials/)*
|
40
|
+
- *[Documentation](https://tequilahub.github.io/tequila-tutorials/docs/sphinx/)*
|
40
41
|
|
41
42
|
Further sources:
|
42
43
|
- [overview article](https://arxiv.org/abs/2011.03057)
|
@@ -44,8 +45,8 @@ Further sources:
|
|
44
45
|
- [talks and slides](https://kottmanj.github.io/talks_and_material/)
|
45
46
|
|
46
47
|
# Installation
|
47
|
-
Recommended Python version is 3.
|
48
|
-
Tequila supports linux, osx and windows. However, not all optional dependencies are supported on windows.
|
48
|
+
Recommended Python version is 3.10 (3.11).
|
49
|
+
Tequila supports linux, osx and windows. However, not all optional dependencies (especially chemistry) are supported on windows.
|
49
50
|
|
50
51
|
## Install from PyPi
|
51
52
|
**Do not** install like this: (Minecraft lovers excluded)
|
@@ -56,7 +57,7 @@ You can install tequila from PyPi as:
|
|
56
57
|
pip install tequila-basic
|
57
58
|
```
|
58
59
|
this will install tequila with all essential dependencies.
|
59
|
-
We recommend to install some fast quantum backends, like qulacs
|
60
|
+
We recommend to install some fast quantum backends, like qulacs, as well.
|
60
61
|
Those can be installed before or after you install tequila.
|
61
62
|
```bash
|
62
63
|
# install basic tequila
|
@@ -157,7 +158,7 @@ print("VQE : {:+2.8}f".format(result.energy))
|
|
157
158
|
print("FCI : {:+2.8}f".format(fci))
|
158
159
|
```
|
159
160
|
|
160
|
-
Do you want to create your own methods? Check out the [tutorials](https://github.com/tequilahub/tequila-tutorials)!
|
161
|
+
Do you want to create your own methods? Check out the [tutorials]([https://github.com/tequilahub/tequila-tutorials](https://tequilahub.github.io/tequila-tutorials/))!
|
161
162
|
|
162
163
|
# Some Research projects using Tequila
|
163
164
|
J.S. Kottmann, A. Anand, A. Aspuru-Guzik.
|
@@ -322,12 +323,7 @@ pip install pyscf
|
|
322
323
|
Works similar as Psi4. Classical methods are also integrated in the madness interface allowing to use them in a basis-set-free representation.
|
323
324
|
|
324
325
|
# Documentation
|
325
|
-
|
326
|
-
Open the documentation with a browser over like `firefox docs/build/html/index.html`
|
327
|
-
Note that you will need some additional python packages like `sphinx` and `mr2` that are not explicitly listed in the requirements.txt
|
328
|
-
|
329
|
-
You can also visit our prebuild online [documentation](https://tequilahub.github.io/tequila/)
|
330
|
-
that will correspond to the github master branch
|
326
|
+
see [here](https://tequilahub.github.io/tequila-tutorials/docs/sphinx/)
|
331
327
|
|
332
328
|
# How to contribute
|
333
329
|
If you find any bugs or inconveniences in `tequila` please don't be shy and let us know.
|
@@ -339,9 +335,11 @@ Here is how that works:
|
|
339
335
|
1. Make a fork of `tequila` to your own github account.
|
340
336
|
2. Checkout the `devel` branch and make sure it is up to date with the main [github repository](https://github.com/aspuru-guzik-group/tequila).
|
341
337
|
3. Create and checkout a new branch from `devel` via `git branch pr-my-branch-name` followed by `git checkout pr-my-branch-name`. By typing `git branch` afterwards you can check which branch is currently checked out on your computer.
|
342
|
-
4. Introduce changes to the code
|
343
|
-
5.
|
344
|
-
|
338
|
+
4. Introduce changes to the code.
|
339
|
+
5. Format your code using [Ruff](https://github.com/astral-sh/ruff).
|
340
|
+
You can install Ruff with `pip install ruff`, then run the formatter with `ruff format` and the linter with `ruff check` (most IDEs also provide a way of integrating Ruff and doing this automatically).
|
341
|
+
6. Commit them with git and push the changes to *your* github account
|
342
|
+
7. Log into github and create a pull request to the main [github repository](https://github.com/aspuru-guzik-group/tequila). The pull-request should be directed to the `devel` branch (but we can also change that afterwards).
|
345
343
|
|
346
344
|
If you plan to introduce major changes to the base library it can be beneficial to contact us first.
|
347
345
|
This way we might be able to avoid conflicts before they arise.
|
@@ -409,4 +407,3 @@ They can be installed for example over visual studio.
|
|
409
407
|
Tequila runs on Mac OSX.
|
410
408
|
You might get in trouble with installing qulacs since it currently does not work with Apple's clang compiler.
|
411
409
|
You need to install latest GNU compile (at least gcc-7 and g++7) and set them as default before installing qulacs over pip.
|
412
|
-
|
@@ -9,7 +9,8 @@ Tequila can execute the underlying quantum expectation values on state of the ar
|
|
9
9
|
# Getting Started
|
10
10
|
|
11
11
|
Get started with our collection of
|
12
|
-
- *[Tutorials](https://tequilahub.github.io/tequila-tutorials/)*
|
12
|
+
- *[Tutorials](https://tequilahub.github.io/tequila-tutorials/)*
|
13
|
+
- *[Documentation](https://tequilahub.github.io/tequila-tutorials/docs/sphinx/)*
|
13
14
|
|
14
15
|
Further sources:
|
15
16
|
- [overview article](https://arxiv.org/abs/2011.03057)
|
@@ -17,8 +18,8 @@ Further sources:
|
|
17
18
|
- [talks and slides](https://kottmanj.github.io/talks_and_material/)
|
18
19
|
|
19
20
|
# Installation
|
20
|
-
Recommended Python version is 3.
|
21
|
-
Tequila supports linux, osx and windows. However, not all optional dependencies are supported on windows.
|
21
|
+
Recommended Python version is 3.10 (3.11).
|
22
|
+
Tequila supports linux, osx and windows. However, not all optional dependencies (especially chemistry) are supported on windows.
|
22
23
|
|
23
24
|
## Install from PyPi
|
24
25
|
**Do not** install like this: (Minecraft lovers excluded)
|
@@ -29,7 +30,7 @@ You can install tequila from PyPi as:
|
|
29
30
|
pip install tequila-basic
|
30
31
|
```
|
31
32
|
this will install tequila with all essential dependencies.
|
32
|
-
We recommend to install some fast quantum backends, like qulacs
|
33
|
+
We recommend to install some fast quantum backends, like qulacs, as well.
|
33
34
|
Those can be installed before or after you install tequila.
|
34
35
|
```bash
|
35
36
|
# install basic tequila
|
@@ -130,7 +131,7 @@ print("VQE : {:+2.8}f".format(result.energy))
|
|
130
131
|
print("FCI : {:+2.8}f".format(fci))
|
131
132
|
```
|
132
133
|
|
133
|
-
Do you want to create your own methods? Check out the [tutorials](https://github.com/tequilahub/tequila-tutorials)!
|
134
|
+
Do you want to create your own methods? Check out the [tutorials]([https://github.com/tequilahub/tequila-tutorials](https://tequilahub.github.io/tequila-tutorials/))!
|
134
135
|
|
135
136
|
# Some Research projects using Tequila
|
136
137
|
J.S. Kottmann, A. Anand, A. Aspuru-Guzik.
|
@@ -295,12 +296,7 @@ pip install pyscf
|
|
295
296
|
Works similar as Psi4. Classical methods are also integrated in the madness interface allowing to use them in a basis-set-free representation.
|
296
297
|
|
297
298
|
# Documentation
|
298
|
-
|
299
|
-
Open the documentation with a browser over like `firefox docs/build/html/index.html`
|
300
|
-
Note that you will need some additional python packages like `sphinx` and `mr2` that are not explicitly listed in the requirements.txt
|
301
|
-
|
302
|
-
You can also visit our prebuild online [documentation](https://tequilahub.github.io/tequila/)
|
303
|
-
that will correspond to the github master branch
|
299
|
+
see [here](https://tequilahub.github.io/tequila-tutorials/docs/sphinx/)
|
304
300
|
|
305
301
|
# How to contribute
|
306
302
|
If you find any bugs or inconveniences in `tequila` please don't be shy and let us know.
|
@@ -312,9 +308,11 @@ Here is how that works:
|
|
312
308
|
1. Make a fork of `tequila` to your own github account.
|
313
309
|
2. Checkout the `devel` branch and make sure it is up to date with the main [github repository](https://github.com/aspuru-guzik-group/tequila).
|
314
310
|
3. Create and checkout a new branch from `devel` via `git branch pr-my-branch-name` followed by `git checkout pr-my-branch-name`. By typing `git branch` afterwards you can check which branch is currently checked out on your computer.
|
315
|
-
4. Introduce changes to the code
|
316
|
-
5.
|
317
|
-
|
311
|
+
4. Introduce changes to the code.
|
312
|
+
5. Format your code using [Ruff](https://github.com/astral-sh/ruff).
|
313
|
+
You can install Ruff with `pip install ruff`, then run the formatter with `ruff format` and the linter with `ruff check` (most IDEs also provide a way of integrating Ruff and doing this automatically).
|
314
|
+
6. Commit them with git and push the changes to *your* github account
|
315
|
+
7. Log into github and create a pull request to the main [github repository](https://github.com/aspuru-guzik-group/tequila). The pull-request should be directed to the `devel` branch (but we can also change that afterwards).
|
318
316
|
|
319
317
|
If you plan to introduce major changes to the base library it can be beneficial to contact us first.
|
320
318
|
This way we might be able to avoid conflicts before they arise.
|
@@ -382,4 +380,3 @@ They can be installed for example over visual studio.
|
|
382
380
|
Tequila runs on Mac OSX.
|
383
381
|
You might get in trouble with installing qulacs since it currently does not work with Apple's clang compiler.
|
384
382
|
You need to install latest GNU compile (at least gcc-7 and g++7) and set them as default before installing qulacs over pip.
|
385
|
-
|
@@ -18,6 +18,8 @@ openfermion ~= 1.0 # can not be smaller than 1.0
|
|
18
18
|
#pyquil<3.0 # you also need to install the forest-sdk
|
19
19
|
##qulacs-gpu # you can't have #qulacs and #qulacs-gpu at the same time
|
20
20
|
#qibo <= 0.1.1 # can not be installed in the same environment as gpyopt
|
21
|
+
#quimb
|
22
|
+
#mqt.ddsim == 2.0.0b2 # requires qiskit < 2
|
21
23
|
|
22
24
|
#optional optimizers
|
23
25
|
#gpyopt # not in combination with qibo as quantum backend
|
@@ -4,55 +4,52 @@ import sys
|
|
4
4
|
|
5
5
|
# on Windows: remove jax and jaxlib from requirements.txt and add autgrad
|
6
6
|
|
7
|
+
|
7
8
|
def read_requirements(fname):
|
8
|
-
with open(
|
9
|
-
lines=file.readlines()
|
9
|
+
with open("requirements.txt") as file:
|
10
|
+
lines = file.readlines()
|
10
11
|
requirements = [line.strip() for line in lines]
|
11
12
|
return requirements
|
12
13
|
|
14
|
+
|
13
15
|
# get author and version information
|
14
|
-
VERSIONFILE="src/tequila/version.py"
|
15
|
-
info = {"__version__":None, "__author__":None}
|
16
|
+
VERSIONFILE = "src/tequila/version.py"
|
17
|
+
info = {"__version__": None, "__author__": None}
|
16
18
|
with open(VERSIONFILE, "r") as f:
|
17
19
|
for l in f.readlines():
|
18
20
|
tmp = l.split("=")
|
19
21
|
if tmp[0].strip().lower() in info:
|
20
|
-
info[tmp[0].strip().lower()] = tmp[1].strip().strip("
|
22
|
+
info[tmp[0].strip().lower()] = tmp[1].strip().strip('"').strip("'")
|
21
23
|
|
22
|
-
for k,v in info.items():
|
24
|
+
for k, v in info.items():
|
23
25
|
if v is None:
|
24
|
-
raise Exception("could not find {} string in {}".format(k,VERSIONFILE))
|
26
|
+
raise Exception("could not find {} string in {}".format(k, VERSIONFILE))
|
25
27
|
|
26
|
-
extras_3_6 = [
|
28
|
+
extras_3_6 = ["dataclasses"]
|
27
29
|
extras_3_7 = []
|
28
30
|
additional = []
|
29
31
|
|
30
|
-
requirements = read_requirements(
|
32
|
+
requirements = read_requirements("requirements.txt")
|
31
33
|
|
32
34
|
try:
|
33
35
|
with open("README.md", "r") as f:
|
34
|
-
long_description=f.read()
|
35
|
-
except:
|
36
|
-
long_description=""
|
36
|
+
long_description = f.read()
|
37
|
+
except Exception:
|
38
|
+
long_description = ""
|
37
39
|
|
38
40
|
setup(
|
39
|
-
name=
|
41
|
+
name="tequila-basic",
|
40
42
|
version=info["__version__"],
|
41
43
|
author=info["__author__"],
|
42
44
|
url="https://github.com/tequilahub/tequila",
|
43
45
|
description="A High-Level Abstraction Framework for Quantum Algorithms",
|
44
|
-
author_email=
|
46
|
+
author_email="jakob.kottmann@gmail.com",
|
45
47
|
long_description=long_description,
|
46
48
|
long_description_content_type="text/markdown",
|
47
49
|
install_requires=requirements + additional,
|
48
|
-
extras_require={
|
49
|
-
|
50
|
-
|
51
|
-
},
|
52
|
-
packages=find_packages(where='src'),
|
53
|
-
package_dir={'': 'src'},
|
50
|
+
extras_require={':python_version < "3.7"': extras_3_6, ':python_version == "3.7"': extras_3_7},
|
51
|
+
packages=find_packages(where="src"),
|
52
|
+
package_dir={"": "src"},
|
54
53
|
include_package_data=True,
|
55
|
-
package_data={
|
56
|
-
'': [os.path.join('src')]
|
57
|
-
}
|
54
|
+
package_data={"": [os.path.join("src")]},
|
58
55
|
)
|
@@ -1,25 +1,37 @@
|
|
1
1
|
from tequila.utils import BitString, BitNumbering, BitStringLSB, initialize_bitstring, TequilaException, TequilaWarning
|
2
2
|
from tequila.circuit import gates, QCircuit, NoiseModel, compile_circuit, CircuitCompiler
|
3
3
|
from tequila.hamiltonian import paulis, QubitHamiltonian, PauliString
|
4
|
-
from tequila.objective import
|
5
|
-
|
6
|
-
|
4
|
+
from tequila.objective import (
|
5
|
+
Objective,
|
6
|
+
VectorObjective,
|
7
|
+
ExpectationValue,
|
8
|
+
Variable,
|
9
|
+
assign_variable,
|
10
|
+
format_variable_dictionary,
|
11
|
+
vectorize,
|
12
|
+
)
|
7
13
|
from tequila.objective import QTensor
|
8
14
|
from tequila.objective.braket import BraKet, make_transition, make_overlap, Overlap, Fidelity
|
9
15
|
|
10
|
-
# backward compatibility
|
11
|
-
braket = BraKet
|
12
|
-
|
13
16
|
from tequila.optimizers import INSTALLED_OPTIMIZERS, show_available_optimizers
|
14
17
|
from tequila.optimizers import minimize, minimize_scipy, minimize_gd, optimizer_scipy
|
15
18
|
|
16
|
-
from tequila.simulators.simulator_api import
|
17
|
-
|
18
|
-
|
19
|
+
from tequila.simulators.simulator_api import (
|
20
|
+
simulate,
|
21
|
+
compile,
|
22
|
+
compile_to_function,
|
23
|
+
draw,
|
24
|
+
pick_backend,
|
25
|
+
INSTALLED_SAMPLERS,
|
26
|
+
INSTALLED_SIMULATORS,
|
27
|
+
SUPPORTED_BACKENDS,
|
28
|
+
INSTALLED_BACKENDS,
|
29
|
+
show_available_simulators,
|
30
|
+
)
|
19
31
|
from tequila.wavefunction import QubitWaveFunction
|
20
32
|
from tequila.circuit.qasm import export_open_qasm, import_open_qasm, import_open_qasm_from_file
|
21
33
|
from tequila.circuit.pyzx import convert_to_pyzx, convert_from_pyzx
|
22
|
-
import tequila.quantumchemistry as chemistry
|
34
|
+
import tequila.quantumchemistry as chemistry # shortcut
|
23
35
|
from tequila.quantumchemistry import Molecule, MoleculeFromOpenFermion, MoleculeFromTequila
|
24
36
|
|
25
37
|
# make sure to use the jax/autograd numpy for objectives
|
@@ -32,11 +44,14 @@ from tequila.tools.random_generators import make_random_circuit, make_random_ham
|
|
32
44
|
# get rid of the jax GPU/CPU warnings
|
33
45
|
import warnings
|
34
46
|
|
35
|
-
warnings.filterwarnings("ignore", module="jax")
|
36
|
-
warnings.filterwarnings("ignore", module="absl")
|
37
|
-
warnings.filterwarnings("default", category=TequilaWarning)
|
38
|
-
|
39
47
|
# load applications and helpers
|
40
48
|
from tequila.apps import adapt
|
41
49
|
|
42
50
|
from .version import __version__, __author__
|
51
|
+
|
52
|
+
# backward compatibility
|
53
|
+
braket = BraKet
|
54
|
+
|
55
|
+
warnings.filterwarnings("ignore", module="jax")
|
56
|
+
warnings.filterwarnings("ignore", module="absl")
|
57
|
+
warnings.filterwarnings("default", category=TequilaWarning)
|
@@ -3,7 +3,8 @@ from tequila.apps.unary_state_prep import UnaryStatePrep
|
|
3
3
|
from tequila.apps import adapt
|
4
4
|
from tequila.apps import krylov
|
5
5
|
|
6
|
-
|
6
|
+
|
7
|
+
def gem(circuits: list, H, variables: dict = None, *args, **kwargs):
|
7
8
|
"""
|
8
9
|
Solve the generalized eigenvalue equation: HC = ESC
|
9
10
|
with matries Hij = <i|H|j>, Sij = <i|j> and states |i> = U[i]|00...0> generated by the circuits given
|
@@ -24,13 +25,21 @@ def gem(circuits:list, H, variables:dict=None, *args, **kwargs):
|
|
24
25
|
----------
|
25
26
|
a tuple of eigenenergies E and eigenvectors C in the same format as numpy.linalg.eigh
|
26
27
|
"""
|
27
|
-
|
28
|
+
|
28
29
|
varnames = sum([U.extract_variables() for U in circuits], [])
|
29
30
|
if len(varnames) > 0:
|
30
31
|
if variables is None:
|
31
|
-
raise TequilaException(
|
32
|
+
raise TequilaException(
|
33
|
+
"GEM method: no variables dictionary given, but circuits have {} variables:\n{}".format(
|
34
|
+
len(varnames), str(varnames)
|
35
|
+
)
|
36
|
+
)
|
32
37
|
for k in varnames:
|
33
38
|
if k not in variables:
|
34
|
-
raise TequilaException(
|
39
|
+
raise TequilaException(
|
40
|
+
"GEM method: you gave a parametrized circuit, but the variable {} was not set in the variables dictionary".format(
|
41
|
+
k
|
42
|
+
)
|
43
|
+
)
|
35
44
|
|
36
|
-
return krylov.krylov_method(krylov_circs=circuits,H=H,variables=variables)
|
45
|
+
return krylov.krylov_method(krylov_circs=circuits, H=H, variables=variables)
|