pyqrack-cuda 1.42.0__tar.gz → 1.42.2__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.
- {pyqrack_cuda-1.42.0/pyqrack_cuda.egg-info → pyqrack_cuda-1.42.2}/PKG-INFO +1 -1
- {pyqrack_cuda-1.42.0 → pyqrack_cuda-1.42.2}/pyqrack/qrack_neuron_torch_layer.py +5 -5
- {pyqrack_cuda-1.42.0 → pyqrack_cuda-1.42.2}/pyqrack/stats/quantize_by_range.py +2 -2
- {pyqrack_cuda-1.42.0 → pyqrack_cuda-1.42.2/pyqrack_cuda.egg-info}/PKG-INFO +1 -1
- {pyqrack_cuda-1.42.0 → pyqrack_cuda-1.42.2}/setup.py +1 -1
- {pyqrack_cuda-1.42.0 → pyqrack_cuda-1.42.2}/LICENSE +0 -0
- {pyqrack_cuda-1.42.0 → pyqrack_cuda-1.42.2}/MANIFEST.in +0 -0
- {pyqrack_cuda-1.42.0 → pyqrack_cuda-1.42.2}/Makefile +0 -0
- {pyqrack_cuda-1.42.0 → pyqrack_cuda-1.42.2}/README.md +0 -0
- {pyqrack_cuda-1.42.0 → pyqrack_cuda-1.42.2}/pyproject.toml +0 -0
- {pyqrack_cuda-1.42.0 → pyqrack_cuda-1.42.2}/pyqrack/__init__.py +0 -0
- {pyqrack_cuda-1.42.0 → pyqrack_cuda-1.42.2}/pyqrack/neuron_activation_fn.py +0 -0
- {pyqrack_cuda-1.42.0 → pyqrack_cuda-1.42.2}/pyqrack/pauli.py +0 -0
- {pyqrack_cuda-1.42.0 → pyqrack_cuda-1.42.2}/pyqrack/qrack_circuit.py +0 -0
- {pyqrack_cuda-1.42.0 → pyqrack_cuda-1.42.2}/pyqrack/qrack_neuron.py +0 -0
- {pyqrack_cuda-1.42.0 → pyqrack_cuda-1.42.2}/pyqrack/qrack_simulator.py +0 -0
- {pyqrack_cuda-1.42.0 → pyqrack_cuda-1.42.2}/pyqrack/qrack_system/__init__.py +0 -0
- {pyqrack_cuda-1.42.0 → pyqrack_cuda-1.42.2}/pyqrack/qrack_system/qrack_system.py +0 -0
- {pyqrack_cuda-1.42.0 → pyqrack_cuda-1.42.2}/pyqrack/quimb_circuit_type.py +0 -0
- {pyqrack_cuda-1.42.0 → pyqrack_cuda-1.42.2}/pyqrack/stats/__init__.py +0 -0
- {pyqrack_cuda-1.42.0 → pyqrack_cuda-1.42.2}/pyqrack/stats/load_quantized_data.py +0 -0
- {pyqrack_cuda-1.42.0 → pyqrack_cuda-1.42.2}/pyqrack_cuda.egg-info/SOURCES.txt +0 -0
- {pyqrack_cuda-1.42.0 → pyqrack_cuda-1.42.2}/pyqrack_cuda.egg-info/dependency_links.txt +0 -0
- {pyqrack_cuda-1.42.0 → pyqrack_cuda-1.42.2}/pyqrack_cuda.egg-info/not-zip-safe +0 -0
- {pyqrack_cuda-1.42.0 → pyqrack_cuda-1.42.2}/pyqrack_cuda.egg-info/requires.txt +0 -0
- {pyqrack_cuda-1.42.0 → pyqrack_cuda-1.42.2}/pyqrack_cuda.egg-info/top_level.txt +0 -0
- {pyqrack_cuda-1.42.0 → pyqrack_cuda-1.42.2}/setup.cfg +0 -0
@@ -28,13 +28,13 @@ def powerset(iterable):
|
|
28
28
|
return chain.from_iterable(combinations(s, r) for r in range(len(s)+1))
|
29
29
|
|
30
30
|
|
31
|
-
class QrackTorchNeuron(nn.Module):
|
31
|
+
class QrackTorchNeuron(nn.Module if _IS_TORCH_AVAILABLE else object):
|
32
32
|
"""Torch wrapper for QrackNeuron
|
33
33
|
|
34
34
|
Attributes:
|
35
35
|
neuron(QrackNeuron): QrackNeuron backing this torch wrapper
|
36
36
|
"""
|
37
|
-
def __init__(self, neuron: QrackNeuron)
|
37
|
+
def __init__(self, neuron: QrackNeuron):
|
38
38
|
super().__init__()
|
39
39
|
self.neuron = neuron
|
40
40
|
|
@@ -48,7 +48,7 @@ class QrackTorchNeuron(nn.Module):
|
|
48
48
|
class QrackNeuronFunction(Function if _IS_TORCH_AVAILABLE else object):
|
49
49
|
"""Static forward/backward/apply functions for QrackTorchNeuron"""
|
50
50
|
@staticmethod
|
51
|
-
def forward(ctx, neuron
|
51
|
+
def forward(ctx, neuron):
|
52
52
|
# Save for backward
|
53
53
|
ctx.neuron = neuron
|
54
54
|
|
@@ -75,8 +75,8 @@ class QrackNeuronFunction(Function if _IS_TORCH_AVAILABLE else object):
|
|
75
75
|
|
76
76
|
class QrackNeuronTorchLayer(nn.Module if _IS_TORCH_AVAILABLE else object):
|
77
77
|
"""Torch layer wrapper for QrackNeuron (with power set of neurons between inputs and outputs)"""
|
78
|
-
def __init__(self, simulator
|
79
|
-
activation
|
78
|
+
def __init__(self, simulator, input_indices, output_indices,
|
79
|
+
activation=int(NeuronActivationFn.Generalized_Logistic), parameters=None):
|
80
80
|
"""
|
81
81
|
Initialize a QrackNeuron layer for PyTorch with a power set of neurons connecting inputs to outputs.
|
82
82
|
The inputs and outputs must take the form of discrete, binary features (loaded manually into the backing QrackSimulator)
|
@@ -7,7 +7,7 @@ try:
|
|
7
7
|
# Written by Elara (custom OpenAI GPT)
|
8
8
|
import numpy as np
|
9
9
|
|
10
|
-
def quantize_by_range(data
|
10
|
+
def quantize_by_range(data, feature_indices, bits):
|
11
11
|
"""
|
12
12
|
Discretize selected features of a dataset into binary variables using numpy.linspace binning.
|
13
13
|
|
@@ -35,7 +35,7 @@ try:
|
|
35
35
|
|
36
36
|
return np.hstack(new_features)
|
37
37
|
except ImportError:
|
38
|
-
def quantize_by_range(data, feature_indices
|
38
|
+
def quantize_by_range(data, feature_indices, bits):
|
39
39
|
"""
|
40
40
|
Discretize selected features of a dataset into binary variables using numpy.linspace binning.
|
41
41
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|