| Lplus |
Ran ran on a synthesized input |
moble/spherical/spherical/modes/derivatives.py code served (permissive licence) · get_code("c3d66f4bf7cc4dca") 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 MockSWSH. 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
import math
class MockSWSH(np.ndarray):
"""Mock SWSH (spin-weighted spherical harmonics) array"""
def __new__(cls, spin_weight, ell_max, shape):
# Calculate number of modes needed
num_modes = sum(2*ell + 1 for ell in range(abs(spin_weight), ell_max + 1))
full_shape = shape + (num_modes,)
obj = np.zeros(full_shape, dtype=np.complex128).view(cls)
obj.spin_weight = spin_weight
obj.ell_max = ell_max
obj._spin_weight = spin_weight
obj._ell_max = ell_max
return obj
def __array_finalize__(self, obj):
if obj is None:
return
self.spin_weight = getattr(obj, 'spin_weight', 0)
self.ell_max = getattr(obj, 'ell_max', 3)
self._spin_weight = getattr(obj, '_spin_weight', 0)
self._ell_max = getattr(obj, '_ell_max', 3)
def index(self, ell, m):
"""Convert (ell, m) to linear index in mode array"""
idx = 0
for l in range(abs(self.spin_weight), ell):
idx += 2*l + 1
idx += m + ell
return idx
# Create a mock SWSH instance
spin_weight = 0
ell_max = 3
self = MockSWSH(spin_weight, ell_max, shape=(2,))
# Fill with some test values
for ell in range(abs(spin_weight), ell_max + 1):
for m in range(-ell, ell + 1):
idx = self.index(ell, m)
self[..., idx] = 1.0 + 0.1j * (ell + m)
ARGS = {
'self': self
}
- 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 MockSWSH — a MockSWSH output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MockSWSH output the recorded ndim 2 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
|
| Lsquared |
Ran ran on a synthesized input |
moble/spherical/spherical/modes/derivatives.py code served (permissive licence) · get_code("595a6ead31c8a3c5") 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 MockSWSHArray. 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
class MockSWSHArray:
"""Mock SWSH array with the interface needed by Lsquared"""
def __init__(self, spin_weight, ell_max):
self.spin_weight = spin_weight
self.ell_max = ell_max
# Create underlying numpy array with enough space for all modes
# For each ell from |s| to ell_max, we have 2*ell+1 m values
total_size = 0
self._ell_ranges = {}
for ell in range(abs(spin_weight), ell_max + 1):
start_idx = total_size
end_idx = total_size + (2 * ell + 1)
self._ell_ranges[ell] = (start_idx, end_idx)
total_size = end_idx
# Create data array with shape (batch, time, total_modes)
self._data = np.random.randn(2, 3, total_size)
def copy(self):
"""Return a copy of self"""
new_obj = MockSWSHArray(self.spin_weight, self.ell_max)
new_obj._data = self._data.copy()
new_obj._ell_ranges = self._ell_ranges.copy()
return new_obj
def view(self, dtype):
"""Return view as numpy array"""
return self._data.view(dtype)
def index(self, ell, m):
"""Get the index for mode (ell, m)"""
start_idx, end_idx = self._ell_ranges[ell]
# m ranges from -ell to +ell, so index within this ell is (m + ell)
return start_idx + (m + ell)
def __getitem__(self, key):
return self._data[key]
def __setitem__(self, key, value):
self._data[key] = value
# Create mock self object with the Lsquared method bound to it
class MockSWSHObject:
def __init__(self):
pass
def Lsquared(self):
"""Total angular-momentum operator"""
import numpy as np
d = self.copy()
s = d.view(np.ndarray)
for ell in range(abs(self.spin_weight), self.ell_max + 1):
s[..., d.index(ell, -ell):d.index(ell, ell) + 1] *= ell * (ell + 1)
return d
# Create instance with mock data
mock_self = MockSWSHArray(spin_weight=0, ell_max=3)
ARGS = {
"self": mock_self
}
- 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 MockSWSHArray — a MockSWSHArray output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MockSWSHArray 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
|
| Lsquared |
Ran ran on a synthesized input |
moble/spherical_functions/spherical_functions/SWSH_modes/derivatives.py code served (permissive licence) · get_code("831e0350f8581c71") 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 MockSWSH. 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
class MockSWSH(np.ndarray):
"""Mock SWSH (Spin-Weighted Spherical Harmonics) array with required attributes and methods"""
def __new__(cls, input_array, s=0, ell_max=3):
obj = np.asarray(input_array).view(cls)
obj.s = s
obj.ell_max = ell_max
return obj
def __array_finalize__(self, obj):
if obj is None:
return
self.s = getattr(obj, 's', 0)
self.ell_max = getattr(obj, 'ell_max', 3)
def index(self, ell, m):
"""Return the flat index for mode (ell, m) in the data array"""
# Simple mapping: modes are stored sequentially
# For each ell, we have modes from -ell to +ell
idx = 0
for l in range(abs(self.s), ell):
idx += 2 * l + 1
idx += m + ell
return idx
def copy(self):
"""Return a copy as MockSWSH"""
new_obj = np.array(self).view(MockSWSH)
new_obj.s = self.s
new_obj.ell_max = self.ell_max
return new_obj
# Create a mock SWSH object with spin weight s=0 and max ell=3
# Total modes: (0 to 3 range) sum of (2*ell+1) for ell in [0,1,2,3]
# = 1 + 3 + 5 + 7 = 16 modes
mock_data = np.arange(16, dtype=np.complex128).reshape(1, 16)
self = MockSWSH(mock_data, s=0, ell_max=3)
ARGS = {
'self': self
}
- 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 MockSWSH — a MockSWSH output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MockSWSH output the recorded ndim 2 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
|
| Lz |
Ran ran on a synthesized input |
moble/spherical/spherical/modes/derivatives.py code served (permissive licence) · get_code("73b8fa47a7f2bdf5") 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 MockSWSH. 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 collections.abc import Sequence
class MockSWSH:
"""Mock SWSH (Spin-Weighted Spherical Harmonics) array."""
def __init__(self, spin_weight, ell_max, data_shape=(2, 5)):
self.spin_weight = spin_weight
self.ell_max = ell_max
self._data = np.random.rand(*data_shape).astype(np.complex128)
self._index_map = {}
# Build index map for (ell, m) -> flat index
idx = 0
for ell in range(abs(self.spin_weight), self.ell_max + 1):
for m in range(-ell, ell + 1):
self._index_map[(ell, m)] = idx
idx += 1
def copy(self):
"""Return a copy of this SWSH object."""
new_obj = MockSWSH(self.spin_weight, self.ell_max, self._data.shape)
new_obj._data = self._data.copy()
new_obj._index_map = self._index_map.copy()
return new_obj
def view(self, dtype):
"""Return the underlying data array."""
if dtype == np.ndarray:
return self._data
return self._data
def index(self, ell, m):
"""Get the flat index for (ell, m)."""
return self._index_map[(ell, m)]
def __getitem__(self, key):
return self._data[key]
def __setitem__(self, key, value):
self._data[key] = value
# Create a mock SWSH instance
spin_weight = 2
ell_max = 3
swsh_instance = MockSWSH(spin_weight=spin_weight, ell_max=ell_max, data_shape=(2, 15))
# Bind the method to the instance
def Lz(self):
import numpy as np
d = self.copy()
s = d.view(np.ndarray)
for ell in range(abs(self.spin_weight), self.ell_max + 1):
for m in range(-ell, ell + 1):
s[..., d.index(ell, m)] *= m
return d
swsh_instance.Lz = Lz.__get__(swsh_instance, MockSWSH)
ARGS = {
"self": swsh_instance
}
- 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 MockSWSH — a MockSWSH output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MockSWSH 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
|
| Lz |
Ran ran on a synthesized input |
moble/spherical_functions/spherical_functions/SWSH_modes/derivatives.py code served (permissive licence) · get_code("442de9260f805abf") 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 MockSWSHArray. 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
class MockSWSHArray:
"""Mock object that behaves like a SWSH (spin-weighted spherical harmonics) array"""
def __init__(self, s, ell_max, data_shape):
self.s = s # spin weight
self.ell_max = ell_max
self.data = np.random.randn(*data_shape)
def copy(self):
"""Return a copy of self"""
new_obj = MockSWSHArray(self.s, self.ell_max, self.data.shape)
new_obj.data = self.data.copy()
return new_obj
def view(self, dtype):
"""Return the underlying array as a view of given dtype"""
return self.data.view(dtype)
def index(self, ell, m):
"""Map (ell, m) to a linear index in the data array"""
# Simple indexing: flatten the (ell, m) space linearly
# For ell in [abs(s), ell_max] and m in [-ell, ell]
idx = 0
for l in range(abs(self.s), ell + 1):
for mm in range(-l, l + 1):
if l == ell and mm == m:
return idx
idx += 1
return idx
def __setitem__(self, key, value):
"""Set item in the underlying data array"""
self.data[key] = value
def __getitem__(self, key):
"""Get item from the underlying data array"""
return self.data[key]
# Create mock SWSH array with:
# - spin weight s = 2
# - max ell = 3
# - batch shape (2,) so we have 2 samples
s = 2
ell_max = 3
batch_shape = (2,)
# Calculate total number of modes
# For each ell from |s| to ell_max, we have 2*ell + 1 modes
num_modes = sum(2*ell + 1 for ell in range(abs(s), ell_max + 1))
# Create the full data shape: (batch_size, num_modes)
data_shape = batch_shape + (num_modes,)
mock_swsh = MockSWSHArray(s=s, ell_max=ell_max, data_shape=data_shape)
ARGS = {
'self': mock_swsh
}
- 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 MockSWSHArray — a MockSWSHArray output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MockSWSHArray 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
|
| conjugate |
Ran ran on a synthesized input |
moble/spherical/spherical/grid/algebra.py code served (permissive licence) · get_code("ac7964e51cc8f811") 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 Grid. 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 copy
import numpy as np
class Grid:
"""Minimal Grid class to satisfy the conjugate method"""
def __init__(self, data, spin_weight=1, **metadata):
self._data = data
self._metadata = {'spin_weight': spin_weight}
self._metadata.update(metadata)
@property
def spin_weight(self):
return self._metadata['spin_weight']
def view(self, dtype):
"""Return view as numpy array"""
return np.asarray(self._data, dtype=dtype)
def __class__(self):
return Grid
# Create test data
test_array = np.array([[1+2j, 3+4j, 5+6j, 7+8j],
[9+10j, 11+12j, 13+14j, 15+16j]], dtype=np.complex128)
# Create Grid instance
grid_obj = Grid(test_array, spin_weight=2, extra_metadata='test')
# Define arguments for conjugate method
ARGS = {
'self': grid_obj,
'inplace': 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 Grid — a Grid output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Grid 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
|
| conjugate |
Ran ran on a synthesized input |
moble/spherical_functions/spherical_functions/SWSH_grids/algebra.py code served (permissive licence) · get_code("02641c8427a3914f") 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 MockGrid. 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
import copy
class MockGrid:
def __init__(self, data, spin_weight=2, **metadata):
self._data = data
self.s = spin_weight
self._metadata = {
'spin_weight': spin_weight,
**metadata
}
def view(self, dtype):
return self._data.view(dtype)
def conjugate(self, inplace=False):
"""Return Grid object corresponding to conjugated function
The result has spin weight equal to the negative of this object's spin weight.
"""
s = self.view(np.ndarray)
c = s if inplace else np.empty_like(s)
np.conjugate(s, out=c)
if inplace:
self._metadata['spin_weight'] = -self.s
return self
metadata = copy.copy(self._metadata)
metadata['spin_weight'] = -self.s
return type(self)(c, **metadata)
# Create a small grid with complex data
grid_data = np.array([1+2j, 3+4j, 5+6j, 7+8j], dtype=complex)
grid_instance = MockGrid(grid_data, spin_weight=2, other_param="test")
ARGS = {
'self': grid_instance,
'inplace': 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 MockGrid — a MockGrid output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MockGrid 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
|
| truncate_ell |
Ran ran on a synthesized input |
moble/spherical/spherical/modes/utilities.py code served (permissive licence) · get_code("dadda285e9f11330") 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 SphericalHarmonicArray. 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 SphericalHarmonicArray:
"""Stand-in class for spherical harmonic array with ell indexing"""
def __init__(self, data, ell_max):
self.data = data
self.ell_max = ell_max
self._metadata = {'ell_max': ell_max}
def index(self, ell1, ell2):
"""Return linear index for given ell values"""
# Simple indexing: (ell1 * (ell1 + 1)) // 2 + ell2
return (ell1 * (ell1 + 1)) // 2 + ell2
def __getitem__(self, key):
"""Support slicing"""
truncated_data = self.data[key]
return SphericalHarmonicArray(truncated_data, self.ell_max)
# Create a mock self object with the necessary methods and attributes
mock_self = SphericalHarmonicArray(
data=torch.randn(2, 4, 20), # batch, features, coefficients
ell_max=5
)
# The new_ell_max parameter - smaller than current ell_max
new_ell_max = 3
ARGS = {
'self': mock_self,
'new_ell_max': new_ell_max
}
- 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 SphericalHarmonicArray — a SphericalHarmonicArray output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SphericalHarmonicArray 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
|
| truncate_ell |
Ran ran on a synthesized input |
moble/spherical_functions/spherical_functions/SWSH_modes/utilities.py code served (permissive licence) · get_code("73671ccdf95f81a6") 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 SphericalHarmonicArray. 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 SphericalHarmonicArray:
"""Stand-in class for an object with truncate_ell method"""
def __init__(self, data, ell_max):
self.data = data
self.ell_max = ell_max
self._metadata = {'ell_max': ell_max}
def __getitem__(self, key):
"""Support slicing"""
truncated_data = self.data[key]
return SphericalHarmonicArray(truncated_data, self.ell_max)
def index(self, ell1, ell2):
"""Return an index based on ell values
For this stand-in, we'll compute a simple index
that increases with ell values.
"""
# Simple formula: if ell_max is the max, total coefficients ~ (ell_max+1)^2
# index(ell, ell) roughly maps to (ell+1)^2 - 1
return (ell2 + 1) * (ell1 + 1) - 1
# Create a small test instance
# We'll create data with enough elements to support indexing
test_data = torch.randn(2, 64) # batch size 2, 64 coefficients
test_ell_max = 7 # This gives roughly (7+1)^2 = 64 coefficients
sh_array = SphericalHarmonicArray(test_data, test_ell_max)
# Set new_ell_max to a value less than current ell_max
new_ell_max = 4
ARGS = {
'self': sh_array,
'new_ell_max': new_ell_max
}
- 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 SphericalHarmonicArray — a SphericalHarmonicArray output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SphericalHarmonicArray 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
|
| Lplus |
Not yet run unverified (harvested, no recorded run) |
moble/spherical_functions/spherical_functions/SWSH_modes/derivatives.py code served (permissive licence) · get_code("b7c863b42e470047") How it ran |
| conjugate |
Not yet run unverified (harvested, no recorded run) |
moble/spherical/spherical/modes/algebra.py code served (permissive licence) · get_code("2556857c19541ea6") How it ran |
| conjugate |
Not yet run unverified (harvested, no recorded run) |
moble/spherical_functions/spherical_functions/SWSH_modes/algebra.py code served (permissive licence) · get_code("722c133e5142bc31") How it ran |
| grid |
Not yet run unverified (harvested, no recorded run) |
moble/spherical/spherical/modes/utilities.py code served (permissive licence) · get_code("bd39c20114eb94e2") How it ran |
| grid |
Not yet run unverified (harvested, no recorded run) |
moble/spherical_functions/spherical_functions/SWSH_modes/utilities.py code served (permissive licence) · get_code("1adba7e0f60adafc") How it ran |
| index |
Not yet run unverified (harvested, no recorded run) |
moble/spherical/spherical/modes/utilities.py code served (permissive licence) · get_code("21b00aed4b55bdb2") How it ran |
| index |
Not yet run unverified (harvested, no recorded run) |
moble/spherical_functions/spherical_functions/SWSH_modes/utilities.py code served (permissive licence) · get_code("69ad5617df33bfef") How it ran |
| modes |
Not yet run unverified (harvested, no recorded run) |
moble/spherical_functions/spherical_functions/SWSH_grids/utilities.py code served (permissive licence) · get_code("5617b8b481cabbf0") How it ran |