SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2604.07013 · 2026

QNAS: A Neural Architecture Search Framework for Accurate and Efficient Quantum Neural Networks

Muhammad Shafique, Alberto Marchisio, Kooshan Maleki

arXiv · PDF · Open in the Atlas

Code that ran

9 of 14 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 1 has no contract verdict; 5 failures of our instrument; 5 no recorded run), measured 2026-11-22; 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/2604.07013.json · badge: /api/ran/2604.07013.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
Kooshano/QNAS community
Papers with Code archive
9 ran · 5 no recorded run
FunctionStatusWhere it lives
_env_get_float Ran
ran, honoured the contract we drafted
Kooshano/QNAS/qnas/nsga2/problem.py
code served (permissive licence) · get_code("4d7f99ecf435626f")
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) 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 os
from typing import List, Optional

# Clear any existing environment variables that might interfere
if 'TEST_FLOAT_KEY' in os.environ:
    del os.environ['TEST_FLOAT_KEY']

# Test case 1: key exists with valid float value
os.environ['TEST_FLOAT_KEY'] = '3.14'

ARGS = {
    'key': 'TEST_FLOAT_KEY',
    'default': 2.71
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 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
_env_get_int Ran
ran, honoured the contract we drafted
Kooshano/QNAS/qnas/nsga2/problem.py
code served (permissive licence) · get_code("8ed105a683397d95")
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) 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.

import os

def _env_get_int(key: str, default: int) -> int:
    raw = os.environ.get(key)
    if raw is None or raw == '':
        return default
    try:
        return int(raw)
    except ValueError:
        return default

ARGS = {
    "key": "TEST_KEY",
    "default": 42
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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
_env_get_list Ran
ran; our contract draft was wrong, not the code
Kooshano/QNAS/qnas/nsga2/problem.py
code served (permissive licence) · get_code("8b2e84170d54110a")
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) 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
from typing import List

# Clear any existing environment variable to test default behavior
if 'TEST_KEY' in os.environ:
    del os.environ['TEST_KEY']

ARGS = {
    'key': 'TEST_KEY',
    'default_list': ['default1', 'default2', 'default3']
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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
_filter_pairs_by_mode Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Kooshano/QNAS/qnas/nsga2/problem.py
code served (permissive licence) · get_code("1e81173eee59e2fe")
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) and returned list, ndim 2, 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

# Construct valid arguments for _filter_pairs_by_mode

# pairs: List of qubit pairs - can be tuples or lists representing qubit indices
pairs = [(0, 1), (1, 2), (2, 3), (3, 4), (4, 5)]

# mode_int: CNOT mode (0=all, 1=odd, 2=even, 3=none)
mode_int = 1

ARGS = {
    "pairs": pairs,
    "mode_int": mode_int,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 2, dtype family int — 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
_modes_str Ran
ran; our contract draft was wrong, not the code
Kooshano/QNAS/qnas/nsga2/problem.py
code served (permissive licence) · get_code("2b070093dd3c9ba4")
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) 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
import numpy as np
from typing import List

CNOT_MODES = ['all', 'odd', 'even', 'none']

def _modes_str(modes: List[int]) -> str:
    """Convert CNOT modes list to hyphen-separated string.
    
    Args:
        modes: List of CNOT mode integers
        
    Returns:
        String representation (e.g., 'all-odd-none')
    """
    return '-'.join((CNOT_MODES[int(m)] for m in modes))


# Construct valid arguments
modes_example = [0, 1, 2, 3]

ARGS = {
    'modes': modes_example
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, 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
_qlayer_to_wirecut_string Ran
ran; our contract draft was wrong, not the code
Kooshano/QNAS/qnas/nsga2/problem.py
code served (permissive licence) · get_code("5239d69c259cc912")
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) 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
import numpy as np

torch.manual_seed(0)

# Analyze the function signature and body:
# _qlayer_to_wirecut_string(n_qubits: int, depth: int, ent_ranges: list, cnot_modes: list) -> str
# 
# The function:
# - Takes n_qubits (int): number of qubits
# - Takes depth (int): number of variational layers
# - Takes ent_ranges (list): list of entanglement ranges, indexed by layer
# - Takes cnot_modes (list): list of CNOT modes, indexed by layer
# - Iterates through depth layers
# - For each layer, accesses ent_ranges[l] and cnot_modes[l]
# - Calls entangling_pairs(n_qubits, int(ent_ranges[l]))
# - Calls _filter_pairs_by_mode(pairs, int(cnot_modes[l]))

# Valid setup:
n_qubits_val = 4
depth_val = 3
ent_ranges_val = [1, 2, 1]  # One range per layer
cnot_modes_val = [0, 1, 2]  # One mode per layer (0=all, 1=odd, 2=even, 3=none)

ARGS = {
    "n_qubits": n_qubits_val,
    "depth": depth_val,
    "ent_ranges": ent_ranges_val,
    "cnot_modes": cnot_modes_val,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, 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
_suppress_stderr Ran
ran on a synthesized input
Kooshano/QNAS/qnas/nsga2/problem.py
code served (permissive licence) · get_code("e3b66c62342c7405")
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 _GeneratorContextManager. 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 os
import sys
import contextlib

# The function _suppress_stderr is a context manager that takes no parameters
# It is designed to be used with the 'with' statement
# Since it takes no parameters, ARGS should be an empty dict

ARGS = {}
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 _GeneratorContextManager — a _GeneratorContextManager output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a _GeneratorContextManager 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
entangling_pairs Ran
ran, honoured the contract we drafted
Kooshano/QNAS/qnas/nsga2/problem.py
code served (permissive licence) · get_code("51df0556dc0786f6")
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) and returned list, ndim 2, 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
import numpy as np

torch.manual_seed(0)

# Analyze the function:
# - n_qubits: int, number of qubits
# - r: int, entanglement range
# The function uses these as integers in arithmetic operations and range()
# No complex objects needed, just simple integers

ARGS = {
    "n_qubits": 5,
    "r": 2,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 2, dtype family int — 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
f3_num_subcircuits Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Kooshano/QNAS/qnas/nsga2/problem.py
code served (permissive licence) · get_code("02d845633c31bd08")
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 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.

import os
import sys
import contextlib

# Setup torch for reproducibility
import torch
torch.manual_seed(0)

# Create minimal stand-in arguments for f3_num_subcircuits
n_qubits = 4
depth = 2
ent_ranges = [1, 2]  # List of entanglement ranges, one per layer
cnot_modes = [0, 1]  # List of CNOT modes, one per layer
cut_target_qubits = 0  # 0 or None means no cutting, should return 1

ARGS = {
    "n_qubits": n_qubits,
    "depth": depth,
    "ent_ranges": ent_ranges,
    "cnot_modes": cnot_modes,
    "cut_target_qubits": cut_target_qubits,
}
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 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
QConfig Not yet run
unverified (harvested, no recorded run)
Kooshano/QNAS/qnas/nsga2/problem.py
code served (permissive licence) · get_code("b598a79fa61e158b")
How it ran

no invocation recorded.

QNNHyperProblem Not yet run
unverified (harvested, no recorded run)
Kooshano/QNAS/qnas/nsga2/problem.py
code served (permissive licence) · get_code("4c71d22adf7448f4")
How it ran

no invocation recorded.

_get_gpu_id Not yet run
unverified (harvested, no recorded run)
Kooshano/QNAS/qnas/nsga2/problem.py
code served (permissive licence) · get_code("cd49f32dc2bf68df")
How it ran

no invocation recorded.

_get_worker_rank Not yet run
unverified (harvested, no recorded run)
Kooshano/QNAS/qnas/nsga2/problem.py
code served (permissive licence) · get_code("81e16c4255db1028")
How it ran

no invocation recorded.

_next_eval_id Not yet run
unverified (harvested, no recorded run)
Kooshano/QNAS/qnas/nsga2/problem.py
code served (permissive licence) · get_code("a9da2502a8a56511")
How it ran

no invocation recorded.

Also present in other papers' code

Of 14 samples lifted from this paper's linked repositories, 14 carry a function identity and 0 do not. Of the 14 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 14 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

Designing quantum neural networks (QNNs) that are both accurate and deployable on NISQ hardware is challenging. Handcrafted ansätze must balance expressivity, trainability, and resource use, while limited qubits often necessitate circuit cutting. Existing quantum architecture search methods primarily optimize accuracy while only heuristically controlling quantum resources (qubit count, gate counts, depth, shot complexity) and mostly ignore the exponential overhead of circuit cutting, potentially discovering architectures that are accurate but prohibitively expensive to deploy on limited qubit hardware. We introduce QNAS, a neural architecture search framework that unifies hardware aware one shot evaluation, multi objective optimization, and cutting overhead awareness for hybrid quantum classical neural networks (HQNNs). QNAS trains a shared parameter SuperCircuit and uses NSGA-II to optimize three objectives jointly: (i) validation error, (ii) a runtime cost proxy measuring wall clock evaluation time, and (iii) the estimated number of subcircuits under a target qubit budget. Minimizing this cutting overhead reduces the exponential execution cost incurred by circuit partitioning. QNAS evaluates candidate HQNNs under a few epochs of training and discovers clear Pareto fronts that reveal tradeoffs between accuracy, efficiency, and cutting overhead. Across MNIST, Fashion-MNIST, and Iris benchmarks, we observe that embedding type and CNOT mode selection significantly impact both accuracy and efficiency, with angle-y embedding and sparse entangling patterns outperforming other configurations on image datasets, and amplitude embedding excelling on tabular data (Iris). On MNIST, the best architecture achieves 97.16% test accuracy with a compact 8 qubit, 2 layer circuit; on the more challenging Fashion-MNIST, 87.38% with a 5 qubit, 2 layer circuit; and on Iris, 100% validation accuracy with a 4 qubit, 2 layer circuit. QNAS surfaces these design insights automatically during search, guiding practitioners toward architectures that balance accuracy, resource efficiency, and practical deployability on current hardware.

For agents

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

get_harvested_code_for_paper("2604.07013")
get_code_for_paper("2604.07013")
have("2604.07013")

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

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

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

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

Connect an agent — have() is free.