pyqrack-cpu 1.65.5__py3-none-macosx_13_0_x86_64.whl → 1.66.0__py3-none-macosx_13_0_x86_64.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 pyqrack-cpu might be problematic. Click here for more details.

@@ -2292,6 +2292,26 @@ class QrackSimulator:
2292
2292
  self._throw_if_error()
2293
2293
  return list(probs)
2294
2294
 
2295
+ def out_rdm(self, q):
2296
+ """Get reduced density matrix
2297
+
2298
+ Returns the raw reduced density matrix of the simulator, for the qubit list.
2299
+ Warning: State vector or is not always the internal representation leading
2300
+ to sub-optimal performance of the method.
2301
+
2302
+ Raises:
2303
+ RuntimeError: QrackSimulator raised an exception.
2304
+
2305
+ Returns:
2306
+ flat list structure representing the reduced density matrix.
2307
+ """
2308
+ amp_count = 1 << len(q)
2309
+ sqr_amp_count = amp_count * amp_count
2310
+ flat_rdm = self._qrack_complex_byref([complex(0, 0)] * sqr_amp_count)
2311
+ Qrack.qrack_lib.OutReducedDensityMatrix(self.sid, len(q), self._ulonglong_byref(q), flat_rdm)
2312
+ self._throw_if_error()
2313
+ return [complex(r, i) for r, i in self._pairwise(flat_rdm)]
2314
+
2295
2315
  def prob_all(self, q):
2296
2316
  """Probabilities of all subset permutations
2297
2317
 
@@ -87,19 +87,22 @@ class QrackSystem:
87
87
  CFUNCTYPE(c_ulonglong, c_double, c_double),
88
88
  ]
89
89
 
90
- # These next two methods need to have c_double pointers, if PyQrack is built with fp64.
90
+ # These next few methods need to have c_double pointers, if PyQrack is built with fp64.
91
91
  self.qrack_lib.InKet.restype = None
92
92
  self.qrack_lib.OutKet.restype = None
93
93
  self.qrack_lib.OutProbs.restype = None
94
+ self.qrack_lib.OutReducedDensityMatrix.restype = None
94
95
 
95
96
  if self.fppow < 6:
96
97
  self.qrack_lib.InKet.argtypes = [c_ulonglong, POINTER(c_float)]
97
98
  self.qrack_lib.OutKet.argtypes = [c_ulonglong, POINTER(c_float)]
98
99
  self.qrack_lib.OutProbs.argtypes = [c_ulonglong, POINTER(c_float)]
100
+ self.qrack_lib.OutReducedDensityMatrix.argtypes = [c_ulonglong, c_ulonglong, POINTER(c_ulonglong), POINTER(c_float)]
99
101
  else:
100
102
  self.qrack_lib.InKet.argtypes = [c_ulonglong, POINTER(c_double)]
101
103
  self.qrack_lib.OutKet.argtypes = [c_ulonglong, POINTER(c_double)]
102
104
  self.qrack_lib.OutProbs.argtypes = [c_ulonglong, POINTER(c_double)]
105
+ self.qrack_lib.OutReducedDensityMatrix.argtypes = [c_ulonglong, c_ulonglong, POINTER(c_ulonglong), POINTER(c_double)]
103
106
 
104
107
  self.qrack_lib.init.restype = c_ulonglong
105
108
  self.qrack_lib.init.argtypes = []
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyqrack-cpu
3
- Version: 1.65.5
3
+ Version: 1.66.0
4
4
  Summary: pyqrack - Pure Python vm6502q/qrack Wrapper
5
5
  Home-page: https://github.com/vm6502q/pyqrack
6
6
  Author: Daniel Strano
@@ -5,19 +5,19 @@ pyqrack/qrack_ace_backend.py,sha256=Prw1NhVVt0csbHiJeW8MJI9rl1P1YS63sXM5quoNPrI,
5
5
  pyqrack/qrack_circuit.py,sha256=vDCKGbcEHJDFUKprjCpWgit8lXFnMrPimKHURD2_Hj4,19538
6
6
  pyqrack/qrack_neuron.py,sha256=UiJdjAGB6usjAGHWSosSFCUUeIkhh3MtZbsaxfsIsNw,9043
7
7
  pyqrack/qrack_neuron_torch_layer.py,sha256=Bs5BLC2GFevfSpo_jSJ2AZl-hfDRJmzlGN9pFw1CtoQ,6160
8
- pyqrack/qrack_simulator.py,sha256=oeltq684s_Fu3tyaGmbxPGiLsKZ39BsUf54tvmgvB7Y,143989
8
+ pyqrack/qrack_simulator.py,sha256=permYKozj_perr9RWfSagq291KKxOydl6Oi0zMn3ujY,144812
9
9
  pyqrack/qrack_stabilizer.py,sha256=O-7VJ9Vw4h25PK_kesSjIqHXGSo8lLrQLIyGgmzG7Co,2124
10
10
  pyqrack/quimb_circuit_type.py,sha256=Sk-Tmn38kUYmAkJJ75btWuhYZyTXOOezmowFhfdiGDc,621
11
11
  pyqrack/qrack_system/__init__.py,sha256=-oZ9dsb1hixsnrkUJRY_C5DzQ_l6MtifF_Z465BgqV4,334
12
- pyqrack/qrack_system/qrack_system.py,sha256=Ib67dt5Q1YlrD0sJFgkmuW1Yq_7tKraSebzrhx7764c,43070
12
+ pyqrack/qrack_system/qrack_system.py,sha256=9tMZNt6MwRhn3ko_Ey1nOojO_omKDSt0weaFWTkAnro,43391
13
13
  pyqrack/qrack_system/qrack_cl_precompile/qrack_cl_precompile,sha256=8xQYqoFTKIl-5v6ZkqmbWp14Eowkl8ty2vNF2shC5hU,35040
14
- pyqrack/qrack_system/qrack_lib/libqrack_pinvoke.9.24.3.dylib,sha256=m7OeSgnSf76oIn78x2Z_34rk3Fr13E-6pd6JCuYUtOg,3152152
15
- pyqrack/qrack_system/qrack_lib/libqrack_pinvoke.dylib,sha256=m7OeSgnSf76oIn78x2Z_34rk3Fr13E-6pd6JCuYUtOg,3152152
14
+ pyqrack/qrack_system/qrack_lib/libqrack_pinvoke.9.25.0.dylib,sha256=T-G0ZJ3rilLnaQ4mjjxejoBLtEbaj2HmpXfFEESYtyI,3169088
15
+ pyqrack/qrack_system/qrack_lib/libqrack_pinvoke.dylib,sha256=T-G0ZJ3rilLnaQ4mjjxejoBLtEbaj2HmpXfFEESYtyI,3169088
16
16
  pyqrack/stats/__init__.py,sha256=Hla85my2fY_roR9lIjGBVpEG7ySOTMwjWa8D6-kgCnY,276
17
17
  pyqrack/stats/load_quantized_data.py,sha256=z12u9F7Nt3P-i44nY1xxvso_klS6WIHS3iqq7R2_lqE,1184
18
18
  pyqrack/stats/quantize_by_range.py,sha256=UM0_7jJDdQ7g30cR3UQAxkbzkqrmsy1oUfqg0h11FUY,2270
19
- pyqrack_cpu-1.65.5.dist-info/LICENSE,sha256=HxB-7SaWTuewAk1nz-3_3FUD6QhgX73kNT_taKVUTq8,1069
20
- pyqrack_cpu-1.65.5.dist-info/METADATA,sha256=AHYm7mdRhHvb9QoRnF-OYrutrpA3S0PqjyG9cGigfo0,5951
21
- pyqrack_cpu-1.65.5.dist-info/WHEEL,sha256=nZx8s83OrgdDmpcWX-8FgI0sEAjdQimt4SdYsdcCaC8,107
22
- pyqrack_cpu-1.65.5.dist-info/top_level.txt,sha256=YE_3q9JTGRLMilNg2tGP1y7uU-Dx8PDao2OhwoIbv8E,8
23
- pyqrack_cpu-1.65.5.dist-info/RECORD,,
19
+ pyqrack_cpu-1.66.0.dist-info/LICENSE,sha256=HxB-7SaWTuewAk1nz-3_3FUD6QhgX73kNT_taKVUTq8,1069
20
+ pyqrack_cpu-1.66.0.dist-info/METADATA,sha256=pNVdVV2M_S6IMl3YBC5a6gD0ftZqdkzzv_A79Fl4RH0,5951
21
+ pyqrack_cpu-1.66.0.dist-info/WHEEL,sha256=nZx8s83OrgdDmpcWX-8FgI0sEAjdQimt4SdYsdcCaC8,107
22
+ pyqrack_cpu-1.66.0.dist-info/top_level.txt,sha256=YE_3q9JTGRLMilNg2tGP1y7uU-Dx8PDao2OhwoIbv8E,8
23
+ pyqrack_cpu-1.66.0.dist-info/RECORD,,