pyqrack-cuda 1.48.2__tar.gz → 1.49.0__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.
Files changed (29) hide show
  1. {pyqrack_cuda-1.48.2/pyqrack_cuda.egg-info → pyqrack_cuda-1.49.0}/PKG-INFO +1 -1
  2. {pyqrack_cuda-1.48.2 → pyqrack_cuda-1.49.0}/pyqrack/qrack_ace_backend.py +77 -2
  3. {pyqrack_cuda-1.48.2 → pyqrack_cuda-1.49.0}/pyqrack/qrack_simulator.py +40 -0
  4. {pyqrack_cuda-1.48.2 → pyqrack_cuda-1.49.0/pyqrack_cuda.egg-info}/PKG-INFO +1 -1
  5. {pyqrack_cuda-1.48.2 → pyqrack_cuda-1.49.0}/setup.py +1 -1
  6. {pyqrack_cuda-1.48.2 → pyqrack_cuda-1.49.0}/LICENSE +0 -0
  7. {pyqrack_cuda-1.48.2 → pyqrack_cuda-1.49.0}/MANIFEST.in +0 -0
  8. {pyqrack_cuda-1.48.2 → pyqrack_cuda-1.49.0}/Makefile +0 -0
  9. {pyqrack_cuda-1.48.2 → pyqrack_cuda-1.49.0}/README.md +0 -0
  10. {pyqrack_cuda-1.48.2 → pyqrack_cuda-1.49.0}/pyproject.toml +0 -0
  11. {pyqrack_cuda-1.48.2 → pyqrack_cuda-1.49.0}/pyqrack/__init__.py +0 -0
  12. {pyqrack_cuda-1.48.2 → pyqrack_cuda-1.49.0}/pyqrack/neuron_activation_fn.py +0 -0
  13. {pyqrack_cuda-1.48.2 → pyqrack_cuda-1.49.0}/pyqrack/pauli.py +0 -0
  14. {pyqrack_cuda-1.48.2 → pyqrack_cuda-1.49.0}/pyqrack/qrack_circuit.py +0 -0
  15. {pyqrack_cuda-1.48.2 → pyqrack_cuda-1.49.0}/pyqrack/qrack_neuron.py +0 -0
  16. {pyqrack_cuda-1.48.2 → pyqrack_cuda-1.49.0}/pyqrack/qrack_neuron_torch_layer.py +0 -0
  17. {pyqrack_cuda-1.48.2 → pyqrack_cuda-1.49.0}/pyqrack/qrack_stabilizer.py +0 -0
  18. {pyqrack_cuda-1.48.2 → pyqrack_cuda-1.49.0}/pyqrack/qrack_system/__init__.py +0 -0
  19. {pyqrack_cuda-1.48.2 → pyqrack_cuda-1.49.0}/pyqrack/qrack_system/qrack_system.py +0 -0
  20. {pyqrack_cuda-1.48.2 → pyqrack_cuda-1.49.0}/pyqrack/quimb_circuit_type.py +0 -0
  21. {pyqrack_cuda-1.48.2 → pyqrack_cuda-1.49.0}/pyqrack/stats/__init__.py +0 -0
  22. {pyqrack_cuda-1.48.2 → pyqrack_cuda-1.49.0}/pyqrack/stats/load_quantized_data.py +0 -0
  23. {pyqrack_cuda-1.48.2 → pyqrack_cuda-1.49.0}/pyqrack/stats/quantize_by_range.py +0 -0
  24. {pyqrack_cuda-1.48.2 → pyqrack_cuda-1.49.0}/pyqrack_cuda.egg-info/SOURCES.txt +0 -0
  25. {pyqrack_cuda-1.48.2 → pyqrack_cuda-1.49.0}/pyqrack_cuda.egg-info/dependency_links.txt +0 -0
  26. {pyqrack_cuda-1.48.2 → pyqrack_cuda-1.49.0}/pyqrack_cuda.egg-info/not-zip-safe +0 -0
  27. {pyqrack_cuda-1.48.2 → pyqrack_cuda-1.49.0}/pyqrack_cuda.egg-info/requires.txt +0 -0
  28. {pyqrack_cuda-1.48.2 → pyqrack_cuda-1.49.0}/pyqrack_cuda.egg-info/top_level.txt +0 -0
  29. {pyqrack_cuda-1.48.2 → pyqrack_cuda-1.49.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrack-cuda
3
- Version: 1.48.2
3
+ Version: 1.49.0
4
4
  Summary: pyqrack - Pure Python vm6502q/qrack Wrapper
5
5
  Home-page: https://github.com/vm6502q/pyqrack
6
6
  Author: Daniel Strano
@@ -65,9 +65,11 @@ class QrackAceBackend:
65
65
 
66
66
  col_seq = [True] * long_range_columns + [False]
67
67
  len_col_seq = len(col_seq)
68
- self._is_col_long_range = (col_seq * ((self.row_length + len_col_seq - 1) // len_col_seq))[:self.row_length]
68
+ self._is_col_long_range = (
69
+ col_seq * ((self.row_length + len_col_seq - 1) // len_col_seq)
70
+ )[: self.row_length]
69
71
  if long_range_columns < self.row_length:
70
- self._is_col_long_range[-1] = False
72
+ self._is_col_long_range[-1] = False
71
73
  self._hardware_offset = []
72
74
  tot_qubits = 0
73
75
  for _ in range(self.col_length):
@@ -142,6 +144,26 @@ class QrackAceBackend:
142
144
  self._cy_shadow(c, t)
143
145
  self.sim.x(t)
144
146
 
147
+ def _ccz_shadow(self, c1, q2, q3):
148
+ self.sim.mcx([q2], q3)
149
+ self.sim.adjt(q3)
150
+ self._cx_shadow(c1, q3)
151
+ self.sim.t(q3)
152
+ self.sim.mcx([q2], q3)
153
+ self.sim.adjt(q3)
154
+ self._cx_shadow(c1, q3)
155
+ self.sim.t(q3)
156
+ self.sim.t(q2)
157
+ self._cx_shadow(c1, q2)
158
+ self.sim.adjt(q2)
159
+ self.sim.t(c1)
160
+ self._cx_shadow(c1, q2)
161
+
162
+ def _ccx_shadow(self, c1, q2, q3):
163
+ self.sim.h(q3)
164
+ self._ccz_shadow(c1, q2, q3)
165
+ self.sim.h(q3)
166
+
145
167
  def _unpack(self, lq, reverse=False):
146
168
  offset = self._hardware_offset[lq]
147
169
 
@@ -198,6 +220,13 @@ class QrackAceBackend:
198
220
 
199
221
  single_bit_value = self.sim.prob(hq[single_bit])
200
222
  single_bit_polarization = max(single_bit_value, 1 - single_bit_value)
223
+
224
+ # Suggestion from Elara (the custom OpenAI GPT):
225
+ # Create phase parity tie before measurement.
226
+ self._ccx_shadow(hq[single_bit], hq[other_bits[0]], self._ancilla)
227
+ self.sim.mcx([hq[other_bits[1]]], self._ancilla)
228
+ self.sim.force_m(self._ancilla, False)
229
+
201
230
  samples = self.sim.measure_shots([hq[other_bits[0]], hq[other_bits[1]]], shots)
202
231
 
203
232
  syndrome_indices = (
@@ -989,3 +1018,49 @@ class QrackAceBackend:
989
1018
  del self._sim
990
1019
 
991
1020
  return _data
1021
+
1022
+ def get_qiskit_basis_gates():
1023
+ return [
1024
+ "id",
1025
+ "u",
1026
+ "u1",
1027
+ "u2",
1028
+ "u3",
1029
+ "r",
1030
+ "rx",
1031
+ "ry",
1032
+ "rz",
1033
+ "h",
1034
+ "x",
1035
+ "y",
1036
+ "z",
1037
+ "s",
1038
+ "sdg",
1039
+ "sx",
1040
+ "sxdg",
1041
+ "p",
1042
+ "t",
1043
+ "tdg",
1044
+ "cx",
1045
+ "cy",
1046
+ "cz",
1047
+ "swap",
1048
+ "iswap",
1049
+ "reset",
1050
+ "measure",
1051
+ ]
1052
+
1053
+ # Provided by Elara (custom OpenAI GPT)
1054
+ def generate_logical_coupling_map(self):
1055
+ coupling_map = []
1056
+ for y in range(self._col_length):
1057
+ for x in range(self._row_length):
1058
+ q = y * self._row_length + x
1059
+ # Define neighbors with orbifolding
1060
+ neighbors = []
1061
+ neighbors.append((x + 1) % self._row_length + y * self._row_length)
1062
+ neighbors.append(x + ((y + 1) % self._col_length) * self._row_length)
1063
+ for nq in neighbors:
1064
+ coupling_map.append([q, nq])
1065
+
1066
+ return coupling_map
@@ -4374,3 +4374,43 @@ class QrackSimulator:
4374
4374
  del self._sim
4375
4375
 
4376
4376
  return _data
4377
+
4378
+ def get_qiskit_basis_gates():
4379
+ return [
4380
+ "id",
4381
+ "u",
4382
+ "u1",
4383
+ "u2",
4384
+ "u3",
4385
+ "r",
4386
+ "rx",
4387
+ "ry",
4388
+ "rz",
4389
+ "h",
4390
+ "x",
4391
+ "y",
4392
+ "z",
4393
+ "s",
4394
+ "sdg",
4395
+ "sx",
4396
+ "sxdg",
4397
+ "p",
4398
+ "t",
4399
+ "tdg",
4400
+ "cu",
4401
+ "cu1",
4402
+ "cu3",
4403
+ "cx",
4404
+ "cy",
4405
+ "cz",
4406
+ "ch",
4407
+ "cp",
4408
+ "csx",
4409
+ "ccx",
4410
+ "ccz",
4411
+ "swap",
4412
+ "iswap",
4413
+ "cswap",
4414
+ "reset",
4415
+ "measure",
4416
+ ]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrack-cuda
3
- Version: 1.48.2
3
+ Version: 1.49.0
4
4
  Summary: pyqrack - Pure Python vm6502q/qrack Wrapper
5
5
  Home-page: https://github.com/vm6502q/pyqrack
6
6
  Author: Daniel Strano
@@ -7,7 +7,7 @@ from setuptools import setup
7
7
  from setuptools.command.build_py import build_py
8
8
 
9
9
 
10
- VERSION = "1.48.2"
10
+ VERSION = "1.49.0"
11
11
 
12
12
  # Read long description from README.
13
13
  README_PATH = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'README.md')
File without changes
File without changes
File without changes
File without changes
File without changes