emu-mps 2.0.3__py3-none-any.whl → 2.1.1__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.
emu_mps/__init__.py CHANGED
@@ -37,4 +37,4 @@ __all__ = [
37
37
  "EntanglementEntropy",
38
38
  ]
39
39
 
40
- __version__ = "2.0.3"
40
+ __version__ = "2.1.1"
@@ -24,7 +24,8 @@ from emu_mps.hamiltonian import make_H, update_H
24
24
  from emu_mps.mpo import MPO
25
25
  from emu_mps.mps import MPS
26
26
  from emu_mps.mps_config import MPSConfig
27
- from emu_mps.noise import compute_noise_from_lindbladians, pick_well_prepared_qubits
27
+ from emu_mps.noise import pick_well_prepared_qubits
28
+ from emu_base.jump_lindblad_operators import compute_noise_from_lindbladians
28
29
  import emu_mps.optimatrix as optimat
29
30
  from emu_mps.tdvp import (
30
31
  evolve_pair,
@@ -563,13 +564,18 @@ def permute_bitstrings(results: Results, perm: torch.Tensor) -> None:
563
564
  def permute_occupations_and_correlations(results: Results, perm: torch.Tensor) -> None:
564
565
  for corr in ["occupation", "correlation_matrix"]:
565
566
  if corr not in results.get_result_tags():
566
- return
567
+ continue
567
568
 
568
569
  uuid_corr = results._find_uuid(corr)
569
570
  corrs = results._results[uuid_corr]
570
- results._results[uuid_corr] = [
571
- optimat.permute_tensor(corr, perm) for corr in corrs
572
- ]
571
+ results._results[uuid_corr] = (
572
+ [ # vector quantities become lists after results are serialized (e.g. for checkpoints)
573
+ optimat.permute_tensor(
574
+ corr if isinstance(corr, torch.Tensor) else torch.tensor(corr), perm
575
+ )
576
+ for corr in corrs
577
+ ]
578
+ )
573
579
 
574
580
 
575
581
  def permute_atom_order(results: Results, perm: torch.Tensor) -> None:
emu_mps/mps_config.py CHANGED
@@ -43,8 +43,14 @@ class MPSConfig(EmulationConfig):
43
43
  num_gpus_to_use: during the simulation, distribute the state over this many GPUs
44
44
  0=all factors to cpu. As shown in the benchmarks, using multiple GPUs might
45
45
  alleviate memory pressure per GPU, but the runtime should be similar.
46
+ optimize_qubit_ordering: Optimize the register ordering. Improves performance and
47
+ accuracy, but disables certain features.
48
+ interaction_cutoff: Set interaction coefficients below this value to `0`.
49
+ Potentially improves runtime and memory consumption.
50
+ log_level: How much to log. Set to `logging.WARN` to get rid of the timestep info.
51
+ log_file: If specified, log to this file rather than stout.
46
52
  autosave_prefix: filename prefix for autosaving simulation state to file
47
- autosave_dt: minimum time interval in seconds between two autosaves
53
+ autosave_dt: minimum time interval in seconds between two autosaves.
48
54
  Saving the simulation state is only possible at specific times,
49
55
  therefore this interval is only a lower bound.
50
56
  kwargs: arguments that are passed to the base class
@@ -206,7 +212,7 @@ class MPSConfig(EmulationConfig):
206
212
  not_allowed = actual_obs.difference(allowed_permutable_obs)
207
213
  if not_allowed:
208
214
  raise ValueError(
209
- f"emu-mp allows only {allowed_permutable_obs} observables with"
215
+ f"emu-mps allows only {allowed_permutable_obs} observables with"
210
216
  " `optimize_qubit_ordering = True`."
211
217
  f" you provided unsupported {not_allowed}"
212
218
  " To use other observables, please set"
emu_mps/noise.py CHANGED
@@ -1,26 +1,6 @@
1
- import torch
2
1
  import random
3
2
 
4
3
 
5
- def compute_noise_from_lindbladians(lindbladians: list[torch.Tensor]) -> torch.Tensor:
6
- """
7
- Compute the single-qubit Hamiltonian noise term -0.5i∑L†L from all the given lindbladians.
8
- """
9
-
10
- assert all(
11
- lindbladian.shape == (2, 2) for lindbladian in lindbladians
12
- ), "Only single-qubit lindblad operators are supported"
13
-
14
- return (
15
- -1j
16
- / 2.0
17
- * sum(
18
- (lindbladian.T.conj() @ lindbladian for lindbladian in lindbladians),
19
- start=torch.zeros(2, 2, dtype=torch.complex128),
20
- )
21
- )
22
-
23
-
24
4
  def pick_well_prepared_qubits(eta: float, n: int) -> list[bool]:
25
5
  """
26
6
  Randomly pick n booleans such that ℙ(False) = eta.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: emu-mps
3
- Version: 2.0.3
3
+ Version: 2.1.1
4
4
  Summary: Pasqal MPS based pulse emulator built on PyTorch
5
5
  Project-URL: Documentation, https://pasqal-io.github.io/emulators/
6
6
  Project-URL: Repository, https://github.com/pasqal-io/emulators
@@ -25,7 +25,7 @@ Classifier: Programming Language :: Python :: 3.10
25
25
  Classifier: Programming Language :: Python :: Implementation :: CPython
26
26
  Classifier: Programming Language :: Python :: Implementation :: PyPy
27
27
  Requires-Python: >=3.10
28
- Requires-Dist: emu-base==2.0.3
28
+ Requires-Dist: emu-base==2.1.1
29
29
  Description-Content-Type: text/markdown
30
30
 
31
31
  <div align="center">
@@ -1,19 +1,19 @@
1
- emu_mps/__init__.py,sha256=wGG0u1wHUcq_MuDjygyApshJY_ome-TZMVggIfHcgns,734
1
+ emu_mps/__init__.py,sha256=8GuHi09MFuRHfvIoaIJ_S9wMOgLPw9_I52OO7Eosols,734
2
2
  emu_mps/algebra.py,sha256=ngPtTH-j2ZCBWoaJZXlkUyIlug7dY7Q92gzfnRlpPMA,5485
3
3
  emu_mps/custom_callback_implementations.py,sha256=CUs0kW3HRaPE7UeFNQOFbeWJMsz4hS2q4rgS57BBp-A,2411
4
4
  emu_mps/hamiltonian.py,sha256=gOPxNOBmk6jRPPjevERuCP_scGv0EKYeAJ0uxooihes,15622
5
5
  emu_mps/mpo.py,sha256=1ogQ25GZCwMzZ_m449oGHcYyDKrofBCr1eyzzrIPMhQ,8824
6
6
  emu_mps/mps.py,sha256=GIiWxctNmHARgf-PgQc6IHKNCe5HYSnbtlXI6Hc-0wI,20085
7
7
  emu_mps/mps_backend.py,sha256=bS83qFxvdoK-c12_1WaPw6O7xUc7vdWifZNHUzNP5sM,2091
8
- emu_mps/mps_backend_impl.py,sha256=8aPSn6ZGFf4DtTodzajX6WJtQHI9F8eMUN1AbrPzbgw,25611
9
- emu_mps/mps_config.py,sha256=JCK_frUVyMRJjI0NPU-dpCg-uO3JKeVzQMOLDkQ9XVk,8104
10
- emu_mps/noise.py,sha256=h4X2EFjoC_Ok0gZ8I9wN77RANXaVehTBbjkcbY_GAmY,784
8
+ emu_mps/mps_backend_impl.py,sha256=U-fNHVkmQFwi_Hfun0OdJ0vmqi9ncjyJ4gIbEM1mN0Y,25887
9
+ emu_mps/mps_config.py,sha256=WA64iI4SxxKRM8-49mjvXUzrUv4miYolVYOhR0mVmtk,8555
10
+ emu_mps/noise.py,sha256=5BXthepWLKnuSTJfIFuPl2AcYPxUeTJdRc2b28ekkhg,208
11
11
  emu_mps/observables.py,sha256=7GQDH5kyaVNrwckk2f8ZJRV9Ca4jKhWWDsOCqYWsoEk,1349
12
12
  emu_mps/tdvp.py,sha256=0qTw9qhg0WbaAyBgeTpULHrNL0ytj80ZUb1P6GKD7Ww,6172
13
13
  emu_mps/utils.py,sha256=BqRJYAcXqprtZVJ0V_j954ON2bhTdtZiaTojsYyrWrg,8193
14
14
  emu_mps/optimatrix/__init__.py,sha256=fBXQ7-rgDro4hcaBijCGhx3J69W96qcw5_3mWc7tND4,364
15
15
  emu_mps/optimatrix/optimiser.py,sha256=k9suYmKLKlaZ7ozFuIqvXHyCBoCtGgkX1mpen9GOdOo,6977
16
16
  emu_mps/optimatrix/permutations.py,sha256=9DDMZtrGGZ01b9F3GkzHR3paX4qNtZiPoI7Z_Kia3Lc,3727
17
- emu_mps-2.0.3.dist-info/METADATA,sha256=ZU1USoiZ12em9lo4GgAWFiGE0oBT83yXitpm2fx8LvA,3505
18
- emu_mps-2.0.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
19
- emu_mps-2.0.3.dist-info/RECORD,,
17
+ emu_mps-2.1.1.dist-info/METADATA,sha256=45NpjZK-7fd4dqVbo4Q76XqoMecHm_J2jiqX7oPUSKA,3505
18
+ emu_mps-2.1.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
19
+ emu_mps-2.1.1.dist-info/RECORD,,