pyqrack-cuda 1.32.31__tar.gz → 1.33.1__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 (25) hide show
  1. {pyqrack_cuda-1.32.31 → pyqrack_cuda-1.33.1}/Makefile +1 -1
  2. {pyqrack_cuda-1.32.31/pyqrack_cuda.egg-info → pyqrack_cuda-1.33.1}/PKG-INFO +1 -1
  3. {pyqrack_cuda-1.32.31 → pyqrack_cuda-1.33.1}/pyqrack/qrack_circuit.py +48 -1
  4. {pyqrack_cuda-1.32.31 → pyqrack_cuda-1.33.1}/pyqrack/qrack_system/qrack_system.py +6 -0
  5. {pyqrack_cuda-1.32.31 → pyqrack_cuda-1.33.1/pyqrack_cuda.egg-info}/PKG-INFO +1 -1
  6. {pyqrack_cuda-1.32.31 → pyqrack_cuda-1.33.1}/setup.py +1 -1
  7. {pyqrack_cuda-1.32.31 → pyqrack_cuda-1.33.1}/LICENSE +0 -0
  8. {pyqrack_cuda-1.32.31 → pyqrack_cuda-1.33.1}/MANIFEST.in +0 -0
  9. {pyqrack_cuda-1.32.31 → pyqrack_cuda-1.33.1}/README.md +0 -0
  10. {pyqrack_cuda-1.32.31 → pyqrack_cuda-1.33.1}/pyproject.toml +0 -0
  11. {pyqrack_cuda-1.32.31 → pyqrack_cuda-1.33.1}/pyqrack/__init__.py +0 -0
  12. {pyqrack_cuda-1.32.31 → pyqrack_cuda-1.33.1}/pyqrack/neuron_activation_fn.py +0 -0
  13. {pyqrack_cuda-1.32.31 → pyqrack_cuda-1.33.1}/pyqrack/pauli.py +0 -0
  14. {pyqrack_cuda-1.32.31 → pyqrack_cuda-1.33.1}/pyqrack/qrack_neuron.py +0 -0
  15. {pyqrack_cuda-1.32.31 → pyqrack_cuda-1.33.1}/pyqrack/qrack_simulator.py +0 -0
  16. {pyqrack_cuda-1.32.31 → pyqrack_cuda-1.33.1}/pyqrack/qrack_system/__init__.py +0 -0
  17. {pyqrack_cuda-1.32.31 → pyqrack_cuda-1.33.1}/pyqrack/quimb_circuit_type.py +0 -0
  18. {pyqrack_cuda-1.32.31 → pyqrack_cuda-1.33.1}/pyqrack/util/__init__.py +0 -0
  19. {pyqrack_cuda-1.32.31 → pyqrack_cuda-1.33.1}/pyqrack/util/convert_qiskit_circuit_to_qasm_experiment.py +0 -0
  20. {pyqrack_cuda-1.32.31 → pyqrack_cuda-1.33.1}/pyqrack_cuda.egg-info/SOURCES.txt +0 -0
  21. {pyqrack_cuda-1.32.31 → pyqrack_cuda-1.33.1}/pyqrack_cuda.egg-info/dependency_links.txt +0 -0
  22. {pyqrack_cuda-1.32.31 → pyqrack_cuda-1.33.1}/pyqrack_cuda.egg-info/not-zip-safe +0 -0
  23. {pyqrack_cuda-1.32.31 → pyqrack_cuda-1.33.1}/pyqrack_cuda.egg-info/requires.txt +0 -0
  24. {pyqrack_cuda-1.32.31 → pyqrack_cuda-1.33.1}/pyqrack_cuda.egg-info/top_level.txt +0 -0
  25. {pyqrack_cuda-1.32.31 → pyqrack_cuda-1.33.1}/setup.cfg +0 -0
@@ -18,7 +18,7 @@ help:
18
18
  build-deps:
19
19
  ifneq ($(OS),Windows_NT)
20
20
  ifeq ($(QRACK_PRESENT),)
21
- git clone https://github.com/unitaryfund/qrack.git; cd qrack; git checkout a3d985497b4400fa1d72bb4ccda69380659ff2b4; cd ..
21
+ git clone https://github.com/unitaryfund/qrack.git; cd qrack; git checkout 7bdd878a99cc5f5fb6e3a387d4a3f0b119612194; cd ..
22
22
  endif
23
23
  mkdir -p qrack/build
24
24
  ifeq ($(UNAME_S),Linux)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyqrack-cuda
3
- Version: 1.32.31
3
+ Version: 1.33.1
4
4
  Summary: pyqrack - Pure Python vm6502q/qrack Wrapper
5
5
  Home-page: https://github.com/vm6502q/pyqrack
6
6
  Author: Daniel Strano
@@ -217,6 +217,17 @@ class QrackCircuit:
217
217
 
218
218
  return out
219
219
 
220
+ def out_to_string(self):
221
+ """Output optimized circuit to string
222
+
223
+ Outputs the (optimized) circuit to a string.
224
+ """
225
+ string_length = Qrack.qrack_lib.qcircuit_out_to_string_length(self.cid)
226
+ out = ctypes.create_string_buffer(string_length)
227
+ Qrack.qrack_lib.qcircuit_out_to_string(self.cid, out)
228
+
229
+ return out.value.decode("utf-8")
230
+
220
231
  def file_gate_count(filename):
221
232
  """File gate count
222
233
 
@@ -230,6 +241,22 @@ class QrackCircuit:
230
241
  tokens = file.read().split()
231
242
  return int(tokens[1])
232
243
 
244
+ def to_qiskit_circuit(self):
245
+ """Convert to a Qiskit circuit
246
+
247
+ Outputs a Qiskit circuit from a QrackCircuit.
248
+
249
+ Raises:
250
+ RuntimeErorr: Before trying to string_to_qiskit_circuit() with
251
+ QrackCircuit, you must install Qiskit, numpy, and math!
252
+ """
253
+ if not _IS_QISKIT_AVAILABLE:
254
+ raise RuntimeError(
255
+ "Before trying to_qiskit_circuit() with QrackCircuit, you must install Qiskit, numpy, and math!"
256
+ )
257
+
258
+ return QrackCircuit.string_to_qiskit_circuit(self.out_to_string())
259
+
233
260
  def file_to_qiskit_circuit(filename):
234
261
  """Convert an output file to a Qiskit circuit
235
262
 
@@ -251,7 +278,27 @@ class QrackCircuit:
251
278
 
252
279
  tokens = []
253
280
  with open(filename, 'r') as file:
254
- tokens = file.read().split()
281
+ return QrackCircuit.string_to_qiskit_circuit(file.read())
282
+
283
+ def string_to_qiskit_circuit(circ_string):
284
+ """Convert an output string to a Qiskit circuit
285
+
286
+ Reads in an (optimized) circuit from a string
287
+ parameter and outputs a Qiskit circuit.
288
+
289
+ Args:
290
+ circ_string: String representation of circuit
291
+
292
+ Raises:
293
+ RuntimeErorr: Before trying to string_to_qiskit_circuit() with
294
+ QrackCircuit, you must install Qiskit, numpy, and math!
295
+ """
296
+ if not _IS_QISKIT_AVAILABLE:
297
+ raise RuntimeError(
298
+ "Before trying to string_to_qiskit_circuit() with QrackCircuit, you must install Qiskit, numpy, and math!"
299
+ )
300
+
301
+ tokens = circ_string.split()
255
302
 
256
303
  i = 0
257
304
  num_qubits = int(tokens[i])
@@ -1275,3 +1275,9 @@ class QrackSystem:
1275
1275
 
1276
1276
  self.qrack_lib.qcircuit_in_from_file.restype = None
1277
1277
  self.qrack_lib.qcircuit_in_from_file.argtypes = [c_ulonglong, c_char_p]
1278
+
1279
+ self.qrack_lib.qcircuit_out_to_string_length.restype = c_size_t
1280
+ self.qrack_lib.qcircuit_out_to_string_length.argtypes = [c_ulonglong]
1281
+
1282
+ self.qrack_lib.qcircuit_out_to_string.restype = None
1283
+ self.qrack_lib.qcircuit_out_to_string.argtypes = [c_ulonglong, c_char_p]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyqrack-cuda
3
- Version: 1.32.31
3
+ Version: 1.33.1
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.32.31"
10
+ VERSION = "1.33.1"
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