SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2411.02573 · 2024

Optimization Algorithm Design via Electric Circuits

arXiv · PDF · Open in the Atlas

Code that ran

5 of 8 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 3 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 2 failures of our instrument; 3 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2411.02573.json · badge: /api/ran/2411.02573.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
cvxgrp/optimization_via_circuits canonical (classifier label)
classifier basis: census
5 ran · 3 no recorded run
FunctionStatusWhere it lives
const_coeff_expr Ran
ran, honoured the contract we drafted
cvxgrp/optimization_via_circuits/ciropt/sympy_parsing.py
code served (permissive licence) · get_code("5a427cf4531cb67d")
How it ran

Ran 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 (6, 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 sympy as sp
import numpy as np

# Create test expressions
expr_constant = 5
expr_symbolic = sp.symbols('a') * 2 + 3
expr_linear = sp.symbols('x') + sp.symbols('y') * 2

# Create name2idx mapping
name2idx = {
    '1': 0,
    'x': 1,
    'y': 2,
}

# x_size parameter
x_size = 6

ARGS = {
    'expr': expr_constant,
    'name2idx': name2idx,
    'x_size': x_size,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sympy — 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 (6, 1) — shape (6, 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
dadmm Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
cvxgrp/optimization_via_circuits/ciropt/discretized_methods.py
code served (permissive licence) · get_code("b41e142ee4836f2a")
How it ran

Ran 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
import networkx as nx

# Create a small network graph
G = nx.Graph()
G.add_edges_from([(1, 2), (2, 3), (3, 4), (4, 5)])

# Network weight matrix (adjacency-like)
W = np.array([
    [1.0, 0.5, 0.0, 0.0, 0.0],
    [0.5, 1.0, 0.5, 0.0, 0.0],
    [0.0, 0.5, 1.0, 0.5, 0.0],
    [0.0, 0.0, 0.5, 1.0, 0.5],
    [0.0, 0.0, 0.0, 0.5, 1.0]
])

n_nodes = 5
vector_size = 3
itr_num = 3

# Optimal solution and optimal value
x_opt_star = np.random.randn(n_nodes, vector_size)
f_star = 42.0

# Create simple prox operators (identity for simplicity)
def make_prox_operator(node_idx):
    def prox(z, rho):
        return z / (1 + rho)
    return prox

prox_operators = [make_prox_operator(i) for i in range(n_nodes)]

# Create simple fi operators (quadratic functions)
def make_fi_operator(node_idx):
    def fi(x):
        return np.sum(x ** 2) * 0.5
    return fi

fi_operators = [make_fi_operator(i) for i in range(n_nodes)]

# Build ARGS dictionary
ARGS = {
    'alg_type': 'dadmm',
    'problem_spec': {
        'n_nodes': n_nodes,
        'vector_size': vector_size,
    },
    'problem_data': {
        'itr_num': itr_num,
    },
    'network_data': {
        'W': W,
        'G': G,
    },
    'x_opt_star': x_opt_star,
    'f_star': f_star,
    'prox_operators': prox_operators,
    'fi_operators': fi_operators,
    'params': {
        'R': 1.0,
    },
    'printing': False,
    'freq': 50,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
networkx, numpy — 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
find_lambda_nu Ran
ran, honoured the contract we drafted
cvxgrp/optimization_via_circuits/ciropt/sympy_to_solvers.py
code served (permissive licence) · get_code("e5971a9822e7eb57")
How it ran

Ran 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, ndim 1, dtype family int; 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 torch

torch.manual_seed(0)

# The function find_lambda_nu takes a monomial (iterable of strings)
# and counts occurrences of variables starting with 'lamb' and 'nu',
# tracking their indices.

monomial = ['x', 'lamb_1', 'y', 'nu_2', 'z']

ARGS = {
    'monomial': monomial
}
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 tuple, ndim 1, dtype family int — a tuple 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
linear_matrix_expr_to_coeff_matrix Ran
ran, honoured the contract we drafted
cvxgrp/optimization_via_circuits/ciropt/sympy_parsing.py
code served (permissive licence) · get_code("03d56cbabc48b699")
How it ran

Ran 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 (6, 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 sympy as sp
import numpy as np

# Create symbolic variables
x = sp.Symbol('x')
y = sp.Symbol('y')
z = sp.Symbol('z')

# Create a simple matrix expression with linear terms
# The matrix will be 2x3 (size 6)
mat_expr = np.array([
    [1, x, 2*y],
    [3*z, 4, x + y]
], dtype=object)

# Create name2idx mapping for the variables
# Must include '1' for constant terms
name2idx = {
    '1': 0,      # constant terms
    'x': 1,      # coefficient of x
    'y': 2,      # coefficient of y
    'z': 3       # coefficient of z
}

ARGS = {
    'mat_expr': mat_expr,
    'name2idx': name2idx
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sympy — 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 (6, 4) — shape (6, 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
pg_extra Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
cvxgrp/optimization_via_circuits/ciropt/discretized_methods.py
code served (permissive licence) · get_code("5cd5e47e71d2b247")
How it ran

Ran 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
import networkx as nx

# Set seed for reproducibility
np.random.seed(0)

# Problem specification
n_node = 3
vector_size = 4
problem_spec = {
    'n_node': n_node,
    'vector_size': vector_size
}

# Problem data
rho = 0.1
itr_num = 5
problem_data = {
    'rho': rho,
    'itr_num': itr_num
}

# Network data - consensus matrix W
W = np.array([
    [0.4, 0.3, 0.3],
    [0.3, 0.4, 0.3],
    [0.3, 0.3, 0.4]
])

# Create a simple graph for pg_extra_par_c variant
G = nx.Graph()
G.add_nodes_from([1, 2, 3])
G.add_edges_from([(1, 2), (2, 3), (1, 3)])

network_data = {
    'W': W,
    'G': G
}

# Optimal solution and optimal value
x_opt_star = np.random.randn(n_node, vector_size) * 0.1
f_star = 1.5

# Prox operators - one for each node
def make_prox_operator():
    def prox_op(v, rho_val):
        # Simple soft thresholding prox
        return np.sign(v) * np.maximum(np.abs(v) - rho_val, 0)
    return prox_op

prox_operators = [make_prox_operator() for _ in range(n_node)]

# Gradient of h - one for each node
def make_grad_h():
    def grad_h_op(x):
        return 0.1 * x  # Simple quadratic regularizer gradient
    return grad_h_op

grad_h = [make_grad_h() for _ in range(n_node)]

# f_plus_h evaluators - one for each node
def make_f_plus_h():
    def f_plus_h_op(x):
        return np.sum(x**2) * 0.5 + 0.05 * np.sum(np.abs(x))
    return f_plus_h_op

f_plus_h = [make_f_plus_h() for _ in range(n_node)]

# Parameters for pg_extra_par_c variant
params = {
    'R': 0.1,
    'h': 0.05,
    'Capacitance': 0.2
}

ARGS = {
    'alg_type': 'pg_extra',
    'problem_spec': problem_spec,
    'problem_data': problem_data,
    'network_data': network_data,
    'x_opt_star': x_opt_star,
    'f_star': f_star,
    'prox_operators': prox_operators,
    'grad_h': grad_h,
    'f_plus_h': f_plus_h,
    'params': params,
    'printing': False,
    'sc_index_set': None,
    'freq': 50
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
networkx, numpy — 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
sp_v_coeff_matrix Not yet run
unverified (harvested, no recorded run)
cvxgrp/optimization_via_circuits/ciropt/sympy_parsing.py
code served (permissive licence) · get_code("428a8d61cd4779a1")
How it ran

no invocation recorded.

sympy_expression_to_casadi_lamb Not yet run
unverified (harvested, no recorded run)
cvxgrp/optimization_via_circuits/ciropt/sympy_to_solvers.py
code served (permissive licence) · get_code("06ce015cc94a834d")
How it ran

no invocation recorded.

sympy_matrix_to_casadi Not yet run
unverified (harvested, no recorded run)
cvxgrp/optimization_via_circuits/ciropt/sympy_to_solvers.py
code served (permissive licence) · get_code("72ba95f1a562b965")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 8 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

We present a novel methodology for convex optimization algorithm design using ideas from electric RLC circuits. Given an optimization problem, the first stage of the methodology is to design an appropriate electric circuit whose continuous-time dynamics converge to the solution of the optimization problem at hand. Then, the second stage is an automated, computer-assisted discretization of the continuous-time dynamics, yielding a provably convergent discrete-time algorithm. Our methodology recovers many classical (distributed) optimization algorithms and enables users to quickly design and explore a wide range of new algorithms with convergence guarantees.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2411.02573")
get_code_for_paper("2411.02573")
have("2411.02573")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2411.02573.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2411.02573.svg)](https://syntology.ai/paper/2411.02573)

Connect an agent — have() is free.