| Haar |
Ran ran on a synthesized input |
String137/Create-your-design-of-Parameterized-Quantum-Circuits/PQC.py code served (permissive licence) · get_code("294abfcf544bd4f1") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import numpy as np
torch.manual_seed(0)
# Analyze the function:
# - F: a numeric value between 0 and 1 (float)
# - N: a numeric value used in arithmetic (int or float)
# The function performs mathematical operations: comparisons, arithmetic
# No complex objects needed, just simple numeric types
ARGS = {
"F": 0.5,
"N": 3
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| SPSA_gradient |
Ran ran on a synthesized input |
bagmk/Quantum_Machine_Learning_Express/Pyfiles/optimizer.py code served (permissive licence) · get_code("f91945c5fe64f98c") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 1, dtype family float, shape (4,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import numpy as np
# Define a simple loss function that takes parameters and returns a scalar loss
def simple_loss(params):
"""A simple quadratic loss function for testing."""
return np.sum(params ** 2)
# Set random seed for reproducibility
np.random.seed(42)
# Create current parameters - a small numpy array
currentParams = np.array([1.0, 2.0, 3.0, 4.0])
# Set gradient coefficient
gradientCoefficient = 0.01
# Construct the ARGS dictionary
ARGS = {
'loss': simple_loss,
'currentParams': currentParams,
'gradientCoefficient': gradientCoefficient
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ndarray, ndim 1, dtype family float, shape (4,) — shape (4,) as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| SPSA_update |
Ran ran on a synthesized input |
bagmk/Quantum_Machine_Learning_Express/Pyfiles/optimizer.py code served (permissive licence) · get_code("3abd85d5602f1653") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 1, dtype family float, shape (4,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import numpy as np
# Set random seed for reproducibility
np.random.seed(42)
# Define a simple loss function that takes parameters and returns a scalar loss
def simple_loss(params):
"""A simple quadratic loss function for testing."""
return np.sum(params ** 2)
# Create initial parameters - a small array
current_params = np.array([1.0, 2.0, 3.0, 4.0])
# Define coefficients
update_coefficient = 0.01 # a_n: controls step size for parameter update
gradient_coefficient = 0.1 # c_n: controls perturbation magnitude for gradient estimation
ARGS = {
"loss": simple_loss,
"currentParams": current_params,
"updateCoefficient": update_coefficient,
"gradientCoefficient": gradient_coefficient
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ndarray, ndim 1, dtype family float, shape (4,) — shape (4,) as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| approx_haar_entanglement |
Ran ran on a synthesized input |
mballarin97/mps_qnn/qcircha/entanglement/haar_entanglement.py code served (permissive licence) · get_code("bc2ad5e8ad712bd1") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float64, ndim 0, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import numpy as np
# The function approx_haar_entanglement takes two integer parameters:
# num_qubits: Number of qubits (must be a positive integer)
# num_A: Number of qubits in partition A (must be a positive integer <= num_qubits)
ARGS = {
"num_qubits": 5,
"num_A": 2,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| binary |
Ran ran on a synthesized input |
bagmk/Quantum_Machine_Learning_Express/Pyfiles/helpers.py code served (permissive licence) · get_code("eaa911e2106470ff") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
def binary(x):
return '0' * (4 - len('{:b}'.format(x))) + '{:b}'.format(x)
# The function takes a single parameter x that is converted to binary
# It uses format(x) which expects an integer
# Let's provide a small integer value
ARGS = {
'x': 5
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| circuit1 |
Ran ran on a synthesized input |
bagmk/Quantum_Machine_Learning_Express/Pyfiles/circuits_n1.py code served (permissive licence) · get_code("556eb00c750a49e6") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned MockQuantumCircuit. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import numpy as np
# Mock quantum circuit class that has rx and rz methods
class MockQuantumCircuit:
def __init__(self):
self.operations = []
def rx(self, angle, qubit):
self.operations.append(('rx', angle, qubit))
return self
def rz(self, angle, qubit):
self.operations.append(('rz', angle, qubit))
return self
torch.manual_seed(0)
# Calculate the number of theta parameters needed
# For L layers:
# - L iterations of (4 rx gates + 4 rz gates) = 8L parameters
# If repeat != 0:
# - L iterations of (4 rz gates + 4 rx gates) = 8L more parameters
# Total with repeat=1: 16L parameters
# Total with repeat=0: 8L parameters
L = 2
repeat = 1
num_params = 8 * L + 8 * L # 32 parameters for L=2, repeat=1
qc = MockQuantumCircuit()
theta = torch.randn(num_params)
ARGS = {
'qc': qc,
'theta': theta,
'L': L,
'repeat': repeat
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type MockQuantumCircuit — a MockQuantumCircuit output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MockQuantumCircuit output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| circuit2 |
Ran ran on a synthesized input |
bagmk/Quantum_Machine_Learning_Express/Pyfiles/circuits_n1.py code served (permissive licence) · get_code("e6df774e9aa56365") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned MockQuantumCircuit. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import numpy as np
torch.manual_seed(0)
class MockQuantumCircuit:
"""Mock quantum circuit that implements the methods called in circuit2"""
def __init__(self, num_qubits=4):
self.num_qubits = num_qubits
self.operations = []
def rx(self, theta, qubit):
"""RX rotation gate"""
self.operations.append(('rx', theta, qubit))
def rz(self, theta, qubit):
"""RZ rotation gate"""
self.operations.append(('rz', theta, qubit))
def cx(self, control, target):
"""CNOT gate"""
self.operations.append(('cx', control, target))
# Set up parameters for circuit2
L = 2 # number of layers
repeat = 1 # whether to repeat the inverse circuit
# Calculate required theta size:
# Forward pass: L * (4 RX + 4 RZ) = L * 8
# Repeat pass (if repeat != 0): L * (4 RZ + 4 RX) = L * 8
# Total: L * 8 + L * 8 = L * 16
theta_size = L * 16
theta = torch.randn(theta_size)
qc = MockQuantumCircuit(num_qubits=4)
ARGS = {
'qc': qc,
'theta': theta,
'L': L,
'repeat': repeat
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type MockQuantumCircuit — a MockQuantumCircuit output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MockQuantumCircuit output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| circuit3 |
Ran ran on a synthesized input |
bagmk/Quantum_Machine_Learning_Express/Pyfiles/circuits_n1.py code served (permissive licence) · get_code("0a533ecf8e7e5371") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned MockQuantumCircuit. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import numpy as np
# Mock quantum circuit class
class MockQuantumCircuit:
def __init__(self, num_qubits=4):
self.num_qubits = num_qubits
self.operations = []
def rx(self, theta, qubit):
self.operations.append(('rx', theta, qubit))
def rz(self, theta, qubit):
self.operations.append(('rz', theta, qubit))
def crz(self, theta, control, target):
self.operations.append(('crz', theta, control, target))
torch.manual_seed(0)
# Calculate required number of parameters
# For each layer L:
# - 4 RX gates (one per qubit)
# - 4 RZ gates (one per qubit)
# - 3 CRZ gates
# Total per layer: 11 parameters
# If repeat != 0, for each layer L:
# - 3 CRZ gates (reversed order)
# - 4 RZ gates
# - 4 RX gates
# Total per layer in repeat: 11 parameters
L = 2
repeat = 1
# Total theta parameters needed:
# L layers: 11 * L
# If repeat: 11 * L additional
total_params = 11 * L + (11 * L if repeat != 0 else 0)
# Create quantum circuit and theta parameters
qc = MockQuantumCircuit(num_qubits=4)
theta = torch.randn(total_params)
ARGS = {
'qc': qc,
'theta': theta,
'L': L,
'repeat': repeat
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type MockQuantumCircuit — a MockQuantumCircuit output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MockQuantumCircuit output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| convertv |
Ran ran on a synthesized input |
bagmk/Quantum_Machine_Learning_Express/Pyfiles/quantumcircuit.py code served (permissive licence) · get_code("c2bb0f4a9332b7c0") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
from collections import Counter
torch_manual_seed = 0
ARGS = {
'input_dict': ['00', '11', '01', '00', '11', '00']
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| entanglement_bond |
Ran ran on a synthesized input |
mballarin97/mps_qnn/qcircha/entanglement/statevector_entanglement.py code served (permissive licence) · get_code("11d953b038c7850d") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 1, dtype family float, shape (1,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import numpy as np
# Create a valid statevector for a quantum system
# For a 2-qubit system (num_qubits=2), we need a statevector of length 2^2 = 4
# The statevector must be normalized (amplitudes sum to 1)
num_qubits = 2
statevector_length = 2 ** num_qubits
# Create a normalized statevector
# Using a simple superposition state: (|00> + |01> + |10> + |11>) / 2
statevector = np.array([0.5, 0.5, 0.5, 0.5], dtype=np.complex128)
# Verify it's normalized
norm = np.sqrt(np.vdot(statevector, statevector))
statevector = statevector / norm
ARGS = {
'statevector': statevector
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ndarray, ndim 1, dtype family float, shape (1,) — shape (1,) as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| entanglement_entropy |
Ran ran on a synthesized input |
mballarin97/mps_qnn/qcircha/entanglement/statevector_entanglement.py code served (permissive licence) · get_code("f7da0a5ca25d07e1") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float64, ndim 0, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import numpy as np
# For entanglement_entropy, we need:
# - statevector: array-like (a state vector whose length is a power of 2)
# - idx_to_trace: array-like or None (indices to trace away)
# A statevector for a 2-qubit system has length 2^2 = 4
# Create a normalized statevector
statevector = np.array([1/2, 1/2, 1/2, 1/2], dtype=complex)
# Indices to trace away (e.g., trace out qubit 0)
idx_to_trace = [0]
ARGS = {
"statevector": statevector,
"idx_to_trace": idx_to_trace,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| firsttwo |
Ran ran on a synthesized input |
bagmk/Quantum_Machine_Learning_Express/Pyfiles/helpers.py code served (permissive licence) · get_code("545bdd38c59b3a57") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
torch.manual_seed(0)
# The function firsttwo(x) returns x[:2], so x needs to support slicing.
# A tensor or list works. Using a tensor for generality.
x = torch.randn(5, 4)
ARGS = {
"x": x
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| gather_data |
Ran ran on a synthesized input |
mballarin97/mps_qnn/qcircha/utils.py code served (permissive licence) · get_code("10caff1df70c1186") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import os
import json
import tempfile
# Create a temporary directory with sample JSON files
tmpdir = tempfile.mkdtemp()
# Create sample JSON files with the expected structure
sample_data_1 = {
'fmap': 'conv-layer1',
'var_ansatz': 'vqe-ansatz1',
'learning_rate': 0.001,
'batch_size': 32
}
sample_data_2 = {
'fmap': 'conv',
'var_ansatz': 'vqe',
'learning_rate': 0.001,
'batch_size': 64
}
sample_data_3 = {
'fmap': 'linear-layer2',
'var_ansatz': 'qaoa-ansatz2',
'learning_rate': 0.002,
'batch_size': 32
}
# Write sample JSON files to the temporary directory
with open(os.path.join(tmpdir, 'run_001.json'), 'w') as f:
json.dump(sample_data_1, f)
with open(os.path.join(tmpdir, 'run_002.json'), 'w') as f:
json.dump(sample_data_2, f)
with open(os.path.join(tmpdir, 'run_003.json'), 'w') as f:
json.dump(sample_data_3, f)
# Define the arguments for gather_data
ARGS = {
'key': ['learning_rate', 'batch_size'],
'value': [0.001, 32],
'path': tmpdir
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| generate_train_validate_test_data |
Ran ran on a synthesized input |
bagmk/Quantum_Machine_Learning_Express/Pyfiles/experiments.py code served (permissive licence) · get_code("1fa7dea1bc389baf") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import numpy as np
from torch import Tensor
import torch
torch.manual_seed(0)
# Create a small dataset with 2000 samples
# Each sample is a tuple of (feature_array, label)
data = []
for i in range(2000):
# Features: small numpy array of shape (4,)
features = np.random.randn(4).astype(np.float32)
# Label: scalar value between -1 and 1
label = np.random.uniform(-1, 1)
data.append((features, label))
ARGS = {
'data': data,
'train_size': 100,
'validate_size': 500,
'test_size': None,
'randomSeed': 0
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, pandas, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type tuple — a tuple output has no array shape of its own; none is stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| get_reduced_density_matrix |
Ran ran on a synthesized input |
mballarin97/mps_qnn/qcircha/entanglement/statevector_entanglement.py code served (permissive licence) · get_code("07a973acc0ac05ec") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 2, dtype family float, shape (2, 2) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import numpy as np
# Set random seed for reproducibility
np.random.seed(0)
# Create a small quantum state vector
# For a 3-site system with local dimension 2 (qubits), the state vector has shape (2^3,) = (8,)
loc_dim = 2
n_sites = 3
state_vector = np.random.randn(loc_dim ** n_sites) + 1j * np.random.randn(loc_dim ** n_sites)
# Normalize the state
state_vector = state_vector / np.linalg.norm(state_vector)
# Sites to trace out (reduce over)
sites = [0, 1] # Trace away sites 0 and 1, keep site 2
ARGS = {
"psi": state_vector,
"loc_dim": loc_dim,
"n_sites": n_sites,
"sites": sites,
"print_rho": False
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ndarray, ndim 2, dtype family float, shape (2, 2) — shape (2, 2) as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| haar_bond_entanglement |
Ran ran on a synthesized input |
mballarin97/mps_qnn/qcircha/entanglement/haar_entanglement.py code served (permissive licence) · get_code("85d510b0219c6c80") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 1, dtype family float, shape (4,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import numpy as np
# The function haar_bond_entanglement takes a single parameter: num_qubits
# It's an integer representing the number of qubits in the circuit
# Looking at the function body:
# - It checks if num_qubits < 20
# - It creates a list by calling haar_entanglement or approx_haar_entanglement
# in a loop for i in range(1, num_qubits)
# - Returns np.array of these values
# For testing, we'll use a small num_qubits value to keep computation fast
num_qubits_value = 5
ARGS = {
"num_qubits": num_qubits_value
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ndarray, ndim 1, dtype family float, shape (4,) — shape (4,) as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| haar_entanglement |
Ran ran on a synthesized input |
mballarin97/mps_qnn/qcircha/entanglement/haar_entanglement.py code served (permissive licence) · get_code("aa95b5b20bd637f4") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float64, ndim 0, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import numpy as np
# Set random seed for reproducibility
np.random.seed(0)
# Define ARGS dict with all parameters for haar_entanglement
ARGS = {
'num_qubits': 5,
'num_A': 2,
'log_base': 'e'
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| inner_products |
Ran ran on a synthesized input |
mballarin97/mps_qnn/qcircha/expressivity.py code served (permissive licence) · get_code("5ee7df96656c773e") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 1, dtype family float, shape (3,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import numpy as np
# Create a small state_list with shape (num_representations, num_tests, state_dim)
# The function indexes it as state_list[rep, i, :] and state_list[rep, j, :]
# and performs inner products via @ operator, so we need complex vectors
num_reps = 2
num_tests = 3
state_dim = 4
# Create complex-valued state vectors
state_list = np.random.randn(num_reps, num_tests, state_dim) + 1j * np.random.randn(num_reps, num_tests, state_dim)
# rep is used to index the first dimension of state_list
rep = 0
ARGS = {
"state_list": state_list,
"rep": rep
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ndarray, ndim 1, dtype family float, shape (3,) — shape (3,) as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| kl_divergence |
Ran ran on a synthesized input |
String137/Create-your-design-of-Parameterized-Quantum-Circuits/PQC.py code served (permissive licence) · get_code("c8335906d9819c62") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float64, ndim 0, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import numpy as np
# Create valid probability distributions p and q
# KL divergence expects p and q to be probability distributions
# Using small arrays for testing
# p: reference distribution (typically the "true" distribution)
p = np.array([0.5, 0.3, 0.15, 0.05])
# q: approximate distribution
q = np.array([0.4, 0.35, 0.2, 0.05])
ARGS = {
"p": p,
"q": q,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| kl_divergence |
Ran ran on a synthesized input |
mballarin97/mps_qnn/qcircha/expressivity.py code served (permissive licence) · get_code("186b27d35573175a") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float64, ndim 0, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import numpy as np
import scipy as sp
# Create two simple probability distributions
p = [0.1, 0.2, 0.3, 0.4]
q = [0.25, 0.25, 0.25, 0.25]
ARGS = {
"p": p,
"q": q,
"eps": 1e-20
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| list_data |
Ran ran on a synthesized input |
mballarin97/mps_qnn/qcircha/utils.py code served (permissive licence) · get_code("0276a696e329857c") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import os
import tempfile
import json
# Create a temporary directory with some .json files
temp_dir = tempfile.mkdtemp()
# Create some test .json files
test_files = ['data1.json', 'data2.json', 'data3.json', 'readme.txt', 'config.yaml']
for file in test_files:
if file.endswith('.json'):
filepath = os.path.join(temp_dir, file)
with open(filepath, 'w') as f:
json.dump({'test': 'data'}, f)
else:
filepath = os.path.join(temp_dir, file)
with open(filepath, 'w') as f:
f.write('non-json content')
ARGS = {
'path': temp_dir
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| removekey |
Ran ran on a synthesized input |
mballarin97/mps_qnn/qcircha/utils.py code served (permissive licence) · get_code("8375fe0af8142622") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import numpy as np
torch.manual_seed(0)
# Create a test dictionary with various types of values
dictionary = {
'a': 1,
'b': 'hello',
'c': [1, 2, 3],
'd': torch.tensor([1.0, 2.0, 3.0, 4.0]),
'e': 42,
'f': np.array([1, 2, 3])
}
# Create keys to remove
keys = ['b', 'd', 'f']
ARGS = {
'dictionary': dictionary,
'keys': keys
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| cir_ex |
Not yet run unverified (harvested, no recorded run) |
bagmk/Quantum_Machine_Learning_Express/Pyfiles/quantumcircuit.py code served (permissive licence) · get_code("98904c30a9ee0d7e") How it ran |
| circuit1 |
Not yet run unverified (harvested, no recorded run) |
bagmk/Quantum_Machine_Learning_Express/Pyfiles/circuits.py code served (permissive licence) · get_code("141c3f0a6e74a62b") How it ran |
| circuit2 |
Not yet run unverified (harvested, no recorded run) |
bagmk/Quantum_Machine_Learning_Express/Pyfiles/circuits.py code served (permissive licence) · get_code("1ceda998a8bcd40b") How it ran |
| circuit3 |
Not yet run unverified (harvested, no recorded run) |
bagmk/Quantum_Machine_Learning_Express/Pyfiles/circuits.py code served (permissive licence) · get_code("989acb6b0038aab3") How it ran |
| embed |
Not yet run unverified (harvested, no recorded run) |
bagmk/Quantum_Machine_Learning_Express/Pyfiles/quantumcircuit.py code served (permissive licence) · get_code("c2dd4274bdc76329") How it ran |
| expressibility |
Not yet run unverified (harvested, no recorded run) |
String137/Create-your-design-of-Parameterized-Quantum-Circuits/PQC.py code served (permissive licence) · get_code("cc5bba0e12ff805d") How it ran |
| load_data |
Not yet run unverified (harvested, no recorded run) |
bagmk/Quantum_Machine_Learning_Express/Pyfiles/experiments.py code served (permissive licence) · get_code("e1bb89dd0e78b0ce") How it ran |