pyqrack-cuda 1.34.0__tar.gz → 1.34.4__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 (26) hide show
  1. {pyqrack_cuda-1.34.0/pyqrack_cuda.egg-info → pyqrack_cuda-1.34.4}/PKG-INFO +1 -1
  2. {pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4}/pyqrack/qrack_circuit.py +25 -16
  3. {pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4/pyqrack_cuda.egg-info}/PKG-INFO +1 -1
  4. {pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4}/setup.py +1 -1
  5. {pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4}/LICENSE +0 -0
  6. {pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4}/MANIFEST.in +0 -0
  7. {pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4}/Makefile +0 -0
  8. {pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4}/README.md +0 -0
  9. {pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4}/pyproject.toml +0 -0
  10. {pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4}/pyqrack/__init__.py +0 -0
  11. {pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4}/pyqrack/neuron_activation_fn.py +0 -0
  12. {pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4}/pyqrack/pauli.py +0 -0
  13. {pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4}/pyqrack/qrack_neuron.py +0 -0
  14. {pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4}/pyqrack/qrack_simulator.py +0 -0
  15. {pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4}/pyqrack/qrack_system/__init__.py +0 -0
  16. {pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4}/pyqrack/qrack_system/qrack_lib/libqrack_pinvoke.so +0 -0
  17. {pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4}/pyqrack/qrack_system/qrack_system.py +0 -0
  18. {pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4}/pyqrack/quimb_circuit_type.py +0 -0
  19. {pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4}/pyqrack/util/__init__.py +0 -0
  20. {pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4}/pyqrack/util/convert_qiskit_circuit_to_qasm_experiment.py +0 -0
  21. {pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4}/pyqrack_cuda.egg-info/SOURCES.txt +0 -0
  22. {pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4}/pyqrack_cuda.egg-info/dependency_links.txt +0 -0
  23. {pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4}/pyqrack_cuda.egg-info/not-zip-safe +0 -0
  24. {pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4}/pyqrack_cuda.egg-info/requires.txt +0 -0
  25. {pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4}/pyqrack_cuda.egg-info/top_level.txt +0 -0
  26. {pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyqrack-cuda
3
- Version: 1.34.0
3
+ Version: 1.34.4
4
4
  Summary: pyqrack - Pure Python vm6502q/qrack Wrapper
5
5
  Home-page: https://github.com/vm6502q/pyqrack
6
6
  Author: Daniel Strano
@@ -385,6 +385,18 @@ class QrackCircuit:
385
385
 
386
386
  return circ
387
387
 
388
+ def _u3_to_mtrx(params):
389
+ th = float(params[0])
390
+ ph = float(params[1])
391
+ lm = float(params[2])
392
+
393
+ c = math.cos(th / 2)
394
+ s = math.sin(th / 2)
395
+ el = np.exp(1j * lm)
396
+ ep = np.exp(1j * ph)
397
+
398
+ return [ c + 0j, -el * s, ep * s, el * ep * c]
399
+
388
400
  def in_from_qiskit_circuit(circ):
389
401
  """Read a Qiskit circuit into a QrackCircuit
390
402
 
@@ -404,29 +416,26 @@ class QrackCircuit:
404
416
 
405
417
  out = QrackCircuit()
406
418
 
407
- basis_gates = ["u", "cx"]
408
- circ = transpile(circ, basis_gates=basis_gates, optimization_level=3)
419
+ basis_gates = ["x", "y", "z", "u", "cx", "cy", "cz", "cu"]
420
+ circ = transpile(circ, basis_gates=basis_gates, optimization_level=0)
409
421
  for gate in circ.data:
410
422
  o = gate.operation
411
- if o.name == "u":
412
- th = float(o.params[0])
413
- ph = float(o.params[1])
414
- lm = float(o.params[2])
415
-
416
- c = math.cos(th / 2)
417
- s = math.sin(th / 2)
418
-
419
- op = [
420
- c + 0j,
421
- -np.exp(1j * lm) * s,
422
- np.exp(1j * ph) * s,
423
- np.exp(1j * (ph + lm)) * c
424
- ]
423
+ op = []
424
+ if o.name in ["x", "cx"]:
425
+ op = [0, 1, 1, 0]
426
+ elif o.name in ["y", "cy"]:
427
+ op = [0, -1j, 1j, 0]
428
+ elif o.name in ["z", "cz"]:
429
+ op = [1, 0, 0, -1]
430
+ else:
431
+ op = QrackCircuit._u3_to_mtrx(o.params)
432
+ if o.name in ["x", "y", "z", "u"]:
425
433
  out.mtrx(op, circ.find_bit(gate.qubits[0])[0])
426
434
  else:
427
435
  ctrls = []
428
436
  for c in gate.qubits[0:1]:
429
437
  ctrls.append(circ.find_bit(c)[0])
438
+
430
439
  out.ucmtrx(ctrls, [0, 1, 1, 0], circ.find_bit(gate.qubits[1])[0], 1)
431
440
 
432
441
  return out
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyqrack-cuda
3
- Version: 1.34.0
3
+ Version: 1.34.4
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.34.0"
10
+ VERSION = "1.34.4"
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