SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2505.09371 · NeurIPS · 2025

TensorRL-QAS: Reinforcement learning with tensor networks for improved quantum architecture search

Akash Kundu, Stefano Mangini

arXiv · PDF · Open in the Atlas

Code that ran

7 of 9 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; 0 honoured the contract we drafted, 0 violated it and 5 have no contract verdict; 2 failures of our instrument; 2 no recorded run), measured 2026-11-24; 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/2505.09371.json · badge: /api/ran/2505.09371.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
Aqasch/TensorRL-QAS canonical (classifier label)
classifier basis not recorded on the link
7 ran · 2 no recorded run
FunctionStatusWhere it lives
construct_hamiltonian Ran
ran on a synthesized input
Aqasch/TensorRL-QAS/dmrg-to-qc/heisenberg_model.py
code served (permissive licence) · get_code("9dda0e3a6359e78d")
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
from functools import reduce

# The function construct_hamiltonian takes a single parameter 'n'
# which is the number of qubits (an integer)

n = 5

ARGS = {
    "n": n
}
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 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
dict_of_actions_revert_q Ran
ran on a synthesized input
Aqasch/TensorRL-QAS/agents/utils.py
code served (permissive licence) · get_code("7614cca5343f02e1")
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 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
from itertools import product

# The function dict_of_actions_revert_q takes num_qubits as a parameter
# It doesn't use any complex objects, just iterates and builds a dictionary
# num_qubits should be a positive integer

ARGS = {
    "num_qubits": 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 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
dictionary_of_actions Ran
ran on a synthesized input
Aqasch/TensorRL-QAS/agents/utils.py
code served (permissive licence) · get_code("fc9e1adba7d8984c")
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 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
from itertools import product

torch.manual_seed(0)

ARGS = {
    "num_qubits": 3
}
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 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
dictionary_of_actions_hexagon_connectivity Ran
ran on a synthesized input
Aqasch/TensorRL-QAS/agents/utils_topology_restrict.py
code served (permissive licence) · get_code("34a404cabfabf279")
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 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.

# Set up arguments for dictionary_of_actions_hexagon_connectivity

ARGS = {
    "num_qubits": 6
}
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 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
dictionary_of_actions_hexagon_connectivity_reverted Ran
ran on a synthesized input
Aqasch/TensorRL-QAS/agents/utils_topology_restrict.py
code served (permissive licence) · get_code("e0b2c4952d67af2a")
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 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.

from itertools import product

def dictionary_of_actions_hexagon_connectivity_reverted(num_qubits):
    """
    Creates dictionary of actions with generalized honeycomb connectivity pattern.
    """
    dictionary = dict()
    i = 0
    for c, x in product(range(num_qubits - 1, -1, -1), range(num_qubits - 1, 0, -1)):
        dictionary[i] = [c, x, num_qubits, 0]
        i += 1
    'h  denotes rotation axis. 1, 2, 3 -->  X, Y, Z axes '
    for r, h in product(range(num_qubits - 1, -1, -1), range(1, 4)):
        dictionary[i] = [num_qubits, 0, r, h]
        i += 1
    if num_qubits == 6:
        hexagon_connections = [(0, 1), (0, 2), (0, 3), (3, 4), (4, 5)]
    elif num_qubits == 8:
        hexagon_connections = [(0, 1), (0, 2), (0, 3), (3, 4), (4, 5), (4, 6), (6, 7)]
    elif num_qubits == 10:
        hexagon_connections = [(0, 1), (0, 2), (0, 3), (3, 4), (4, 5), (4, 6), (6, 7), (7, 8), (7, 9)]
    valid_actions = []
    for k in dictionary.keys():
        act = dictionary[k]
        ctrl = act[0]
        targ = (act[0] + act[1]) % num_qubits
        tup = (ctrl, targ)
        if tup in hexagon_connections:
            valid_actions.append(act)
    return {len(valid_actions) - 1 - val_act_no: val_act for val_act_no, val_act in enumerate(valid_actions)}

ARGS = {
    "num_qubits": 6
}
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 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
get_args Ran
ran; our contract draft was wrong, not the code
Aqasch/TensorRL-QAS/TensorRL_fixed_noise.py
code served (permissive licence) · get_code("a291234eaf8b4fb6")
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 Namespace. 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 argparse

torch.manual_seed(0)

# The function get_args takes argv as input and parses command-line arguments
# It returns parsed arguments with the following parameters:
# - seed: int (default 0)
# - config: str (default 'h_s_2')
# - experiment_name: str (default 'lower_bound_energy/')
# - gpu_id: int (default 0)

# Construct valid argv list for the function
argv = [
    '--seed', '42',
    '--config', 'h_s_2',
    '--experiment_name', 'lower_bound_energy/',
    '--gpu_id', '0'
]

ARGS = {
    'argv': argv
}
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 Namespace — a Namespace output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Namespace 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
get_config Ran
ran; our contract draft was wrong, not the code
Aqasch/TensorRL-QAS/agents/utils.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from aqasch/kanqas_code, is pointer only (licence: NONE) · get_code("06734a9e368d830d")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from aqasch/kanqas_code, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

agent_test Not yet run
unverified (harvested, no recorded run)
Aqasch/TensorRL-QAS/TensorRL_fixed_noise.py
code served (permissive licence) · get_code("ee51836f8c9ff5d8")
How it ran

no invocation recorded.

modify_state Not yet run
unverified (harvested, no recorded run)
Aqasch/TensorRL-QAS/TensorRL_fixed_noise.py
code served (permissive licence) · get_code("178818204848d96a")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 4 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 0 later) and 5 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.

FunctionAlso present inEarliest-datedOthers named
agent_test 1 other paper
1 dated earlier
2411.00230 (2024-11)
Reinforcement learning with learned gadgets to tackle hard quantum problems on real hardware
get_args 1 other paper
1 dated earlier
2411.00230 (2024-11)
Reinforcement learning with learned gadgets to tackle hard quantum problems on real hardware
get_config 1 other paper
1 dated earlier
2406.17630 (2024-06)
KANQAS: Kolmogorov-Arnold Network for Quantum Architecture Search
modify_state 1 other paper
1 dated earlier
2411.00230 (2024-11)
Reinforcement learning with learned gadgets to tackle hard quantum problems on real hardware

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-24.

Repositories linked to this paper

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

Abstract

Variational quantum algorithms hold the promise to address meaningful quantum problems already on noisy intermediate-scale quantum hardware. In spite of the promise, they face the challenge of designing quantum circuits that both solve the target problem and comply with device limitations. Quantum architecture search (QAS) automates the design process of quantum circuits, with reinforcement learning (RL) emerging as a promising approach. Yet, RL-based QAS methods encounter significant scalability issues, as computational and training costs grow rapidly with the number of qubits, circuit depth, and hardware noise. To address these challenges, we introduce TensorRL-QAS, an improved framework that combines tensor network methods with RL for QAS. By warm-starting the QAS with a matrix product state approximation of the target solution, TensorRL-QAS effectively narrows the search space to physically meaningful circuits and accelerates the convergence to the desired solution. Tested on several quantum chemistry problems of up to 12-qubit, TensorRL-QAS achieves up to a 10-fold reduction in CNOT count and circuit depth compared to baseline methods, while maintaining or surpassing chemical accuracy. It reduces classical optimizer function evaluation by up to 100-fold, accelerates training episodes by up to 98%, and can achieve 50% success probability for 10-qubit systems, far exceeding the <1% rates of baseline. Robustness and versatility are demonstrated both in the noiseless and noisy scenarios, where we report a simulation of an 8-qubit system. Furthermore, TensorRL-QAS demonstrates effectiveness on systems on 20-qubit quantum systems, positioning it as a state-of-the-art quantum circuit discovery framework for near-term hardware and beyond.

For agents

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

get_harvested_code_for_paper("2505.09371")
get_code_for_paper("2505.09371")
have("2505.09371")

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

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

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

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

Connect an agent — have() is free.