Learning to Rank Tensor Network Contraction Plans for GPU-Accelerated Quantum Circuit Simulation
Analyze & explore related research in Conceptio
Connect this record directly into your research workflow or AI agent. Explore citations across open repositories, query full text, and export structured proof bundles.
Learning to Rank Tensor Network Contraction Plans for GPU-Accelerated Quantum Circuit Simulation
arXiv:2608.05819v1 [cs.LG] 6 Aug 2026
Alfred M. Pastor1 , Maribel Castillo2 , and Jose M. Badia2 1
Department of Computer Science, Universitat de València, 46100 Burjassot, Spain
2
Department of Computer Science and Engineering, Universitat Jaume I, 12071 Castelló de la Plana, Spain
to reduce contraction-plan search, while showing that performance remains partly backend dependent.
Classical simulation remains essential for developing and validating quantum algorithms, but its cost grows rapidly with circuit size. Tensor-network contraction can reduce this cost by exploiting circuit structure, although its efficiency depends strongly on the chosen contraction plan. On GPUs, plans with similar theoretical complexity may perform very differently because execution also depends on parallelism, reduction structure, memory traffic, and contraction geometry. We present a learning-to-rank framework for selecting efficient contraction plans before executing them. Each plan is represented by structural features derived directly from its sequence of pairwise contractions, and gradient-boosted rankers are trained from GPU measurements using listwise and pairwise objectives. We evaluate the resulting models on diverse circuit families, using separate in-distribution and circuit-family-shift test sets, and compare them with random and MinFill-based baselines. The learned rankers generally identify better plans, with the listwise model providing the strongest overall decision quality. We also study backend shift by comparing empirical plan orderings on two GPU architectures and evaluating the source-trained models on the second device without retraining. The rankings remain substantially, though not perfectly, stable across GPUs, and the models retain useful decision quality. These results support Learning to Rank as a practical way
1 Introduction Classical simulation remains an important part of quantum-computing research. It supports the design and testing of algorithms, the validation of experiments, and the benchmarking of quantum hardware. State-vector simulation is general and conceptually simple, but its memory requirements grow exponentially with the number of qubits. Tensor-network methods provide an alternative when the circuit has exploitable structure, allowing some simulations to go beyond the sizes that can be handled by storing the complete quantum state [1–3]. The cost of a tensor-network simulation depends strongly on the order in which its tensors are contracted. A contraction plan expresses that order as a sequence of pairwise contractions, and different plans for the same network can have very different computational and memory requirements [4]. Finding an optimal order is NP-hard, so practical tools rely on heuristics such as MinFill, graph partitioning, community detection, and treewidth-oriented search [3, 5–7]. These methods produce useful candidates, but a plan that appears favorable according to a theoretical cost estimate is not necessarily the one that runs fastest on the target hardware. This distinction is particularly relevant on GPUs. Pairwise tensor contractions can often be reduced to tensor permutations and matrix multiplications, operations that make effective use of GPU parallelism. Their execution time, however, is not determined by floating-point count alone. Output dimensions, reduction size, contraction geometry, memory movement, kernel granularity,
Alfred M. Pastor: alfred.pastor@uv.es Maribel Castillo: castillo@uji.es Jose M. Badia: badia@uji.es
1
lar GPU and software stack. The resulting model is therefore not assumed to be hardware independent: backend dependence can enter through the supervision signal even when the backend is not explicitly encoded among the features.
and the balance between many small operations and a few dominant contractions can all affect performance [8, 9]. Plans with similar theoretical complexity may therefore behave differently when executed through a particular GPU and tensorlibrary stack.
We train gradient-boosted rankers with XGBoost [12], using its Normalized Discounted Cumulative Gain (NDCG) and pairwise ranking objectives. The dataset contains 225 circuit groups and seven candidate plans per circuit, generated with several contraction-order heuristics and measured on an NVIDIA RTX A6000. All plans belonging to the same circuit are kept together during partitioning and validation. Model development is followed by evaluation on a locked in-distribution (ID) test set and on an outof-distribution (OOD) set containing the complete quantum Fourier transform (QFT)-based circuit family, comprising QFT circuits and QFTderived benchmark variants. This family is entirely excluded from training and validation. The models are compared with random and MinFillbased ranking strategies using Top-1, Top-3, regret, and win rate.
The practical problem considered here is simple to state: given a quantum circuit and several candidate contraction plans, select the plan expected to minimize execution time, or a short list containing a near-optimal candidate on the GPU. Measuring all of them would reveal the fastest one, but it could require a substantial fraction of the computation that the selection stage is intended to save. In many settings, an exact runtime estimate is also unnecessary. The relevant decision is which plan should be executed, or which small set of plans is worth testing. We formulate this task as a grouped Learning to Rank (LTR) problem. The candidates associated with one circuit form a ranking group, and the model assigns each plan a score used only to order the plans within that group. The intended outputs are either a direct Top-1 choice or a short Top-k list from which the best plan can be selected after a limited number of executions. LTR is designed for this type of ordinal decision and has been used in quantum computing for related selection problems, including the ranking of logically equivalent circuit layouts for execution on quantum hardware [10, 11]. Here, the ranked objects are tensor-network contraction plans and the target ordering is determined by their measured GPU performance.
The NDCG-oriented model includes the fastest plan among its first three recommendations for 96% of the circuits in the locked in-distribution test, with low decision regret. When the complete QFT-based family is withheld from development, its Top-3 rate falls to 62.9%. The model therefore retains useful information for a circuit family it has not seen, but the loss under this form of domain shift is clear. We also study dependence on the execution backend. The same candidate plans are measured on an NVIDIA Tesla V100, and the analysis separates two questions. First, we compare the two empirical ground-truth rankings without involving a learned model; the GPUs select the same fastest plan in 84% of the 225 circuit groups. Second, we keep the Ampere-trained models and their predicted rankings fixed, but evaluate them on the locked test set using labels recomputed from the Volta measurements. Under this zero-shot backend shift, the NDCG-oriented model retains a Top-3 rate of 92%. These results show useful transfer for the two NVIDIA architectures considered, but they do not establish general hardware portability.
Each plan is represented by structural descriptors computed from its sequence of pairwise contractions. They summarize properties related to computational load, output-side parallelism, reduction structure, contraction geometry, and plan granularity. The representation requires neither preliminary execution nor profiling of the candidate plans. It can therefore be evaluated before the expensive tensor contractions are carried out. The labels used for training are obtained from measured execution times. For each circuit, the candidates are evaluated through their speedup relative to the corresponding MinFill plan, and this value is transformed into a graded relevance label. The inputs are derived only from the contraction structure, but the labels reflect a particu-
The current evidence is limited to seven candidates per circuit, one held-out circuit family, and 2
two GPUs supported by closely related software stacks. Within that scope, the experiments indicate that structural information from a contraction plan is sufficient to support useful ranking decisions, that an NDCG-oriented objective gives the best balance of Top-k accuracy and decision regret in the present dataset, and that part of the learned ordering survives both circuit-family and backend shift. The main contributions of this work are:
2 Related Work The intersection of artificial intelligence (AI) and quantum computing is a bidirectional research frontier. On one hand, quantum computing offers the potential to accelerate machine learning tasks, a field often referred to as Quantum Machine Learning (QML). Recent surveys have extensively covered the landscape of QML, highlighting algorithms such as quantum support vector machines, quantum neural networks, and variational quantum classifiers, along with their potential advantages and current limitations on near-term quantum hardware [13, 14]. On the other hand, classical machine learning is increasingly being employed to tackle core challenges in quantum computing. This includes using neural networks for quantum error correction and decoding, as exemplified by the AlphaQubit recurrenttransformer architecture, which learns to predict and correct errors in quantum processors [15]. Such work underscores the growing synergy between the two fields, where classical learning algorithms help advance quantum hardware and simulation capabilities. Beyond quantum error correction, various machine learning techniques have been applied to quantum computing challenges. For instance, support vector machines (SVMs) have been used for quantum state tomography [16] and to classify quantum phases of matter [17]. Supervised learning has also been used to predict suitable device, compiler, and configuration choices for quantum-circuit compilation, reducing the need for exhaustive exploration [18]. Neural networks have been trained to learn the structure of quantum states [19], and to guide variational quantum eigensolvers [20]. One particularly suitable paradigm for candidate selection is LTR, a family of supervised learning techniques designed to optimize the ordering of a list of items rather than predicting their absolute values. LTR methods are widely used in information retrieval, web search, recommendation systems, and natural language processing [10, 21]. In recent years, LTR has also been successfully applied to a diverse range of problems, ranging from e-commerce product search [22, 23] to search engine optimization and document retrieval [24–26]. Only a few studies have applied LTR techniques to quantum computing problems. The
• We formulate GPU contraction-plan selection as a grouped Learning to Rank problem, aimed at choosing either one candidate or a short list of candidates before execution. • We define a fixed-size structural representation of contraction plans that captures GPUrelevant aspects of work, parallelism, reduction, geometry, and granularity without requiring timing measurements at inference time. • We develop a group-aware training and evaluation protocol for NDCG-oriented and pairwise XGBoost rankers, using both ranking accuracy and decision-oriented regret on locked in-distribution and circuit-familyshift test sets. • We examine backend dependence through two separate analyses: the stability of the empirical plan rankings across Ampere and Volta, and the zero-shot evaluation of fixed Ampere-trained models using labels measured on Volta. The remainder of the paper is organized as follows. Section 2 reviews related uses of machine learning and LTR in quantum computing. Section 3 introduces tensor-network simulation, GPU execution of contraction plans, candidategeneration heuristics, and gradient-boosted ranking. Section 4 presents the structural feature representation, with further details in Appendix A. Section 5 describes data collection, grouped validation, feature selection, model optimization, and the experimental platform. Section 6 reports the learning-curve, in-distribution, and circuitfamily-shift results. Section 7 studies groundtruth ranking stability and zero-shot model transfer across GPUs. Section 8 presents the conclusions and planned extensions. 3
most relevant to our research is the work by Li et al. [27], who proposed QCDeploy, an LTR-based method to rank different deployment strategies for quantum circuits on serverless platforms. Another related study by Hartnett et al. [11] introduced an LTR-based approach to rank logically equivalent quantum circuits for hardware-aware layout selection on IBM processors. These studies demonstrate the potential of LTR for automating optimization decisions in quantum computing. To the best of our knowledge, prior work has not applied LTR to tensor-network contraction or to the prediction of contraction-plan efficiency on GPUs. Motivated by this gap, the next section presents an LTR-based framework that ranks candidate contraction plans and identifies the one expected to achieve the fastest execution on modern GPUs, with the aim of reducing the cost of contraction-plan selection in large-scale quantum circuit simulation.
3.2 GPU Execution of Contraction Plans In practice, tensor contractions can be decomposed into tensor permutations, reshaping operations, and matrix multiplications [30, 31]. Consequently, matrix products dominate the arithmetic cost, whereas tensor permutations and memory movement constitute the main sources of overhead. These operations map naturally onto GPU architectures. State-of-the-art simulators such as cuQuantum [8] and qFlex [32] exploit optimized libraries, including cuBLAS and cuTENSOR, to accelerate tensor network simulation. However, execution time depends not only on the number of floating-point operations (FLOPs), but also on memory traffic, contraction geometry, intermediate tensor sizes, and the amount of exposed parallelism. Consequently, contraction plans with similar asymptotic costs may exhibit substantially different runtimes on the same hardware.
3.3 Candidate Contraction Plans
3 Background
A wide variety of heuristics have been proposed to address the contraction-order optimization problem. Although they all pursue the same objective, reducing computational cost and memory consumption, they differ in the criteria used to guide the search and the graph structures they exploit. Consequently, these methods can be broadly grouped into several families according to their underlying principles [3]. Each family emphasizes different trade-offs between computational cost, memory requirements, and graph structure, often producing contraction plans with similar asymptotic costs but different execution characteristics. A first family consists of greedy methods, which iteratively select contractions according to local criteria. Depending on the objective, these heuristics may prioritize minimizing FLOPs [3, 29], intermediate tensor sizes [33], or balancing both factors. Although computationally inexpensive, their local nature may prevent them from finding globally optimal orders. A second family is based on graph elimination and treewidth heuristics. Methods such as MinFill and Min-Degree aim to reduce the effective treewidth of the network, which is closely related to contraction complexity [5, 33]. Another class relies on graph partitioning and
3.1 Tensor Networks for Quantum Circuit Simulation Tensor networks provide a powerful framework for representing quantum many-body states through networks of interconnected tensors [2]. Quantum circuit simulation can be formulated as the contraction of a tensor network, where each quantum gate is represented by a tensor whose indices correspond to the input and output qubits on which it acts [2, 28]. Computing probability amplitudes or observables amounts to contracting the internal indices of the resulting network. Compared with full state-vector simulation, tensor networks exploit local entanglement to alleviate the exponential growth of memory requirements [1]. Their efficiency, however, depends strongly on the contraction plan used to evaluate the network. A contraction plan defines the sequence in which tensors are contracted and therefore determines both the computational cost and the memory footprint of the simulation [1]. Since finding an optimal contraction order is NPhard, practical implementations rely on heuristic methods and must also contend with overheads associated with tensor transpositions and index reordering [29]. 4
we employ XGBoost [12], which combines multiple decision trees in an additive model and provides efficient implementations of ranking objectives with built-in regularization. XGBoost is particularly well suited for structured tabular data and can capture complex non-linear relationships while maintaining computational efficiency. XGBoost supports both pairwise and listwise ranking objectives. The rank:pairwise objective, rooted in RankNet [36], learns relative preferences between pairs of items and seeks to minimize ranking inversions. In contrast, the rank:ndcg objective implements LambdaMART [37], directly optimizing ranking quality through NDCG. Because NDCG emphasizes the top positions of the ranking, it naturally aligns with our goal of selecting reliable Top-1 and Top-3 contraction plans. Like other machine learning models, XGBoost’s performance depends on a set of hyperparameters controlling tree complexity, regularization, and learning behavior. Table 1 summarizes the most important hyperparameters for ranking tasks, while the hyperparameter optimization procedure and the selected configurations are described in Section 5. The choice of these parameters strongly influences the trade-off between bias and variance. For ranking tasks, a moderate learning rate (e.g., η = 0.01), shallow to medium trees (e.g., max_depth = 6), and subsampling (e.g., subsample = 0.7) are commonly employed to avoid overfitting while maintaining high ranking accuracy.
separator techniques. Algorithms such as FlowCutter and community-detection approaches exploit the graph structure to construct efficient contraction orders with favorable memory requirements and lower effective widths [6, 7, 34, 35]. Finally, hypergraph partitioning techniques, as employed by cotengra [3], recursively partition the network and can be combined with slicing strategies to further reduce memory consumption. These approaches are among the most effective for large and complex tensor networks. Although these families often generate contraction plans with similar asymptotic costs, their execution times may differ substantially on GPU architectures. Consequently, selecting the most efficient plan among a set of candidates becomes a decision problem. Rather than generating new contraction orders, the objective of this work is to rank a pool of candidate plans and identify those most likely to achieve the best execution performance on the target GPU.
3.4 Learning to Rank with Gradient Boosted Trees 3.4.1
Learning to Rank
LTR refers to a family of supervised learning techniques designed to optimize the ordering of items rather than their absolute values [10]. LTR methods are commonly categorized into three paradigms: pointwise, pairwise, and listwise. Pointwise methods treat ranking as a regression or classification problem on individual items, pairwise methods learn relative preferences between pairs of items, and listwise methods directly optimize ranking-quality metrics over the entire list. Since the objective of this work is to identify the best contraction plans among a set of candidates rather than predict their exact execution times, LTR provides a natural framework for contraction-plan selection. In particular, practical usage emphasizes ranking quality at the top positions, where selecting the best or near-best plans is more important than accurately modeling the entire ordering. 3.4.2
4 Feature Engineering The contraction path is the dominant algorithmic degree of freedom in exact tensor-network simulation: changing only the order of pairwise contractions can alter both runtime and memory footprint by several orders of magnitude. Classical width-based reasoning explains part of this variability, but it is not sufficient for our setting. In GPU-accelerated contraction, runtime depends not only on the amount of work, but also on output size, reduction structure, contraction geometry, and the amount of exposed parallelism. Our goal is therefore to construct a feature space that is computable directly from a contrac-
Gradient-Boosted Trees for Ranking
Gradient-boosted trees constitute one of the most effective approaches for LTR tasks. In this work, 5
Table 1: Main hyperparameters of XGBoost for learning-to-rank. Parameter
Typical Value
Description
objective
rank:ndcg
eval_metric
ndcg@k
eta
0.01–0.1
max_depth
3–10
subsample
0.5–1.0
colsample_bytree
0.5–1.0
lambda
0–10
gamma
0–5
min_child_weight
1–10
Loss function; rank:ndcg optimizes NDCG directly, while rank:pairwise minimizes the number of misordered pairs [36, 37]. Evaluation metric; NDCG truncated at position k. Learning rate (shrinkage); smaller values require more trees but improve generalization. Maximum depth of each tree; deeper trees capture more complex interactions but increase overfitting risk. Fraction of training instances sampled per tree; adds stochasticity and reduces overfitting. Fraction of features sampled per tree; similar to subsample but for columns. L2 regularization term on leaf weights; larger values penalize large weights. Minimum loss reduction required to split a node; larger values lead to more conservative trees. Minimum sum of instance weights in a child node; prevents overfitting on rare patterns.
tion plan before execution, yet expressive enough to capture the structural factors that most influence measured runtime.
This representation provides a compact abstraction of the local contraction step, since it makes explicit the three structural ingredients that most strongly influence execution: the scale of the local work, the output size, and the reduction dimension.
4.1 Cost-model overview Consider the i-th pairwise contraction step of a plan, Oi = contractSi (Ai , Bi ), (1)
4.2 Step-level primitives From this local model, we define four step-level primitives:
where Si is the set of shared indices contracted between tensors Ai and Bi . For binary tensor networks, it is natural to work in base-2 logarithmic coordinates. Let ki = |Si |,
(2)
mi = rank(Ai ) − ki ,
(3)
ni = rank(Bi ) − ki .
(4)
M = 2mi , K = 2ki , N = 2ni ,
(6)
pi = mi + ni ,
(7)
ki = |Si |, |mi − ni | di = , mi + ni + ε
(8) ε ≪ 1.
(9)
These four quantities form the irreducible basis of our feature space. The exponent ci is a proxy for the local computational burden and scales with the equivalent FLOP count. The exponent pi captures the output size of the step and therefore acts both as a proxy for local memory pressure and for output-side data parallelism.
After a suitable permutation of modes, every pairwise contraction can be written in general matrix multiplication (GEMM)-like form, (M × K) · (K × N ) → (M × N ),
ci = mi + ni + ki ,
(5)
6
dominant region, low reduction-driven reuse, unfavorable contraction geometry, or an accumulation of fine-grained overheads. Keeping these hypotheses explicit at the feature-design stage is useful because it allows subsequent ablation and feature-selection stages to determine which structural mechanisms carry the most predictive signal. A key design choice is that the feature vector is derived entirely from the contraction plan. Consequently, the same plan yields the same feature representation regardless of the GPU on which it is later executed. What changes across backends is the measured runtime, and therefore the supervision signal used for learning and evaluation. Table 2 summarizes the final fixed-size representation used before feature selection. Further technical details of the cost model and the feature blocks are provided in Appendix A.
The quantity ki isolates the reduction dimension and serves as a proxy for reuse and arithmetic intensity. Finally, di measures the imbalance of the equivalent M × N contraction and acts as a compact descriptor of contraction geometry, which is relevant to mapping quality and memory-access regularity.
4.3 Plan-level feature groups A complete contraction plan π is a variable-length sequence of S pairwise steps and must therefore be mapped to a fixed-size vector before it can be used in a tabular learning model. We do this through a set of plan-level aggregations that preserve the main structural aspects of the path. To emphasize the dominant region of the plan, we define the bottleneck exponent cmax = max ci , i
(10)
5 Methodology
and the FLOP-weighted coefficients 2ci −cmax wi = P S . cℓ −cmax ℓ=1 2
This section defines the common methodology used by the two experimental studies that follow. It describes how the candidate plans and relevance labels are constructed, how the data are partitioned and evaluated without group leakage, how the feature set and ranking models are selected, and which hardware and software platforms are used. Sections 6 and 7 then apply this common setup to source-backend evaluation and backend-shift evaluation, respectively.
(11)
The resulting aggregated features are organized into five interpretable groups. The complexity / critical-load block captures the bottleneck, total work, near-critical tail, and overall heterogeneity of the plan. The sequence / granularity block captures fragmentation and the presence of long tails of very small contractions. The parallelism dynamics block measures how much output-side parallelism is available globally and at the bottleneck. The reduction / intensity block characterizes whether the expensive part of the plan is reduction-rich and therefore more likely to benefit from reuse. Finally, the geometry / memory access block summarizes how balanced or skewed the expensive contractions are, which is relevant to kernel efficiency and memory behavior.
5.1 Dataset Construction and Relevance Labels Execution time is backend-dependent, as it varies with the GPU and software stack, whereas the model input is backend-independent because it is computed solely from the contraction plan. Backend dependence therefore enters through the target variable. Let T (Pi ) denote the execution time of a candidate plan Pi on the target GPU, and let Pmf be the corresponding MinFill plan for the same tensor network. We define the relative speedup
4.4 Final inventory and design principles The final feature space therefore combines a small set of local primitives with a deliberately rich set of plan-level aggregations. This partial redundancy is intentional: several aggregated descriptors are correlated, but they encode different hypotheses about what limits runtime in practice, such as a single catastrophic step, a broad nearcritical tail, insufficient output parallelism in the
T (Pmf ) , T (Pi )
(12)
yi = log(1 + Spi ).
(13)
Spi = and the relevance label
7
Table 2: Plan-level features used to represent a contraction plan π as a fixed-size vector. Feature groups are separated by horizontal rules. Features marked † are discarded after selection. ♭ and ♯ are exclusive to opt_pair and opt_ndcg, respectively; all other features are used by both optimized models. Feature name
Definition
Block
Interpretation
max_cost† log2_sum_flops† topq_mean_cost† avg_cost† std_cost♯
maxi ci P ci log2 P i2 |Iq |−1 i∈Iq ci P S −1 i ci std(ci )
Complexity / critical load Complexity / critical load Complexity / critical load Complexity / critical load Complexity / critical load
Bottleneck work exponent. Accumulated work over the full plan. Size of the near-critical tail. Mean work level. Heterogeneity of the cost profile.
n_steps
S
Sequence / granularity
frac_tiny_steps
S −1
Fragmentation of the plan and potential management overhead. Fraction of steps far below the bottleneck scale.
max_out_rank
maxi pi
Parallelism dynamics
avg_out_rank
S −1
P
Parallelism dynamics
costw_out_rank
P
i wi pi
Parallelism dynamics
p_at_max_cost
|Imax |−1
max_red_rank
maxi ki
Reduction / intensity
costw_red_rank♭
P
Reduction / intensity
k_at_max_cost
|Imax |−1
max_asym
maxi di
Geometry / memory access
avg_asym
S −1
P
Geometry / memory access
costw_asym
P
i wi di
Geometry / memory access
d_at_max_cost
|Imax |−1
P
i 1{ci ≤cmax −τ }
i pi
P
i∈Imax pi
i wi ki
P
i∈Imax ki
i di
P
i∈Imax di
Sequence / granularity
Parallelism dynamics
Reduction / intensity
Geometry / memory access
Since ranking is defined within each circuitspecific group of plans, this target is aligned with the goal of selecting the fastest candidate while being less sensitive to global timing scale than absolute runtime. The logarithm reduces the dynamic range of speedups, preserves their ordering, and yields non-negative relevance values suitable for NDCG-based objectives.
Peak output size; proxy for peak local intermediate size and parallel exposure. Average output-size level across the plan. Output parallelism in the expensive part of the plan. Parallel exposure at the bottleneck. Largest reduction dimension encountered. Reduction-richness of the expensive region. Arithmetic-intensity proxy at the bottleneck. Worst contraction imbalance in the plan. Global tendency toward skinny or square contractions. Shape imbalance of the expensive region. Mapping quality at the bottleneck.
of comparison for learned ranking models. Moreover, MinFill and related heuristics are commonly used as baselines in the literature on treewidth and sparse elimination [38, 39], so outperforming it offers a clear and interpretable measure of the added value of our LTR approach. To expose the model to a broad range of contraction behaviors, we built the dataset from a diverse set of quantum circuits, including both well-known benchmarks, such as MQTBench [40], and more irregular instances generated using QXTools. The goal was to induce as much variation as possible in the contraction plans produced by different heuristics and in their measured execution on the GPU. Representative families include QFT-based circuits, Green-
We use MinFill as a baseline because it is a classical and widely adopted heuristic for eliminationorder problems closely related to treewidth, which in turn is a key proxy for tensor-network contraction complexity [1, 3]. In practice, it provides a simple, inexpensive, and reproducible reference that requires neither training data nor hyperparameter tuning, making it a natural point 8
The ID and OOD sets remained locked throughout model development. All valid candidate plans associated with the same circuit instance were assigned to the same subset, thereby preventing circuit-level data leakage. The resulting partition is summarized in Table 3.
berger–Horne–Zeilinger (GHZ), variational quantum eigensolver (VQE), and several classes of random circuits, including random quantum circuit (RQC), among many others. For each circuit, we generated seven candidate contraction plans using structurally diverse heuristics. MinFill and FlowCutter were obtained through QXTools; the remaining candidates were produced using a Girvan–Newman community-detection heuristic [6], the Jdrasil heuristic solver, the Tamaki local-improvement heuristic, and two MinFill-based heuristics submitted by Terrioux et al. to the Parameterized Algorithms and Computational Experiments (PACE) 2017 treewidth challenge [41]. Each plan was then executed on the target GPU to measure its wall-clock time T (Pi ). For each contraction plan, one warm-up run was followed by 50 measured repetitions. The reported runtime is the mean across these repetitions. GPU synchronization was enforced immediately before and after each timed contractionplan execution using CUDA.synchronize(). All computations were performed in single-precision (Float32) arithmetic. Plans, caches, and workspace memory were reused across repetitions to amortize setup overheads. Any out-of-memory or timeout event (10 minutes) caused the run to be aborted and marked as failed, and T those plans were excluded from the subsequent analyses. Consequently, some circuit groups contain fewer than seven valid candidates. CPU–GPU transfers, memory allocation, plan creation, and just-in-time (JIT) compilation times were excluded from the measurement, as they are not part of the contraction itself and would introduce backend-dependent overheads that are not representative of the execution cost in the GPU. This protocol was applied consistently to all contraction plans on both GPU backends.
5.3 Feature Validation and Selection The initial feature representation is first tested with a diagnostic ranking model and group-aware validation. Sanity checks and learning curves are then used to verify that the observed signal is not caused by leakage or trivial artifacts before redundant features are removed. We trained the ranking models with XGBoost.jl [12], using either rank:ndcg or rank:pairwise as the objective. Plans were grouped by circuit so that comparisons were restricted to candidates belonging to the same ranking problem. To evaluate the raw predictive value of the initial 18-feature representation, we began with a simple heuristic configuration. We selected a set of “rule-of-thumb” hyperparameters to evaluate the raw predictive power of the 18-feature vector (x18 ). These parameters were chosen based on established literature for gradient boosting on medium-sized datasets [12, 42] to ensure a balance between learning capacity and training speed: • Objective (rank:ndcg or rank:pairwise): Selected to align the model with the LTR paradigm. • Learning Rate (eta = 0.01): A small learning rate was used to introduce gradual updates and reduce the risk of overfitting. • Tree Depth (max_depth = 6): A moderate depth used to capture non-linear interactions between computational cost and tensor shapes without inducing immediate overfitting.
5.2 Data Partitioning and Evaluation Protocol The 225 circuit-specific ranking groups were partitioned into three disjoint subsets: a development set containing 138 groups, a locked indistribution test set containing 25 groups, and an out-of-distribution set containing the 62 groups from the held-out QFT-based family. The development set was used for feature selection, cross-validation, hyperparameter optimization, learning-curve analysis, and final model fitting.
• Tree Method (gpu_hist): Employed to leverage the computational throughput of the GPU during the histogram construction of the trees [43]. • Regularization (λ = 1, α = 0): Standard L2 regularization to stabilize the initial weight updates. 9
Block
Content
Allowed Use
Development
138 circuit groups
Test (ID)
25 unseen circuit groups from the same domain 62 groups from the held-out QFT-based family
Feature selection, grouped cross-validation, hyperparameter optimization, learning curves, and final model fitting Final evaluation
Out-ofdistribution (OOD)
Circuit-family-shift evaluation
Table 3: Partition of the 225 circuit groups used for model development and final evaluation.
mentary importance analyses: Gain, which reflects the reduction in loss contributed by a feature during tree splits, and Shapley values, which provide a more global view of feature contribution [44, 45]. This analysis showed that 4 of the original 18 features were either highly redundant or contributed negligible predictive signal, and they were therefore removed. The union of the two selected feature sets contained 14 features. Each optimized model used 13 features: 12 shared features and one objective-specific feature, as indicated in Table 2.
• Subsampling (subsample=0.7): A fraction of the training instances was sampled for each tree to reduce overfitting and improve robustness. We evaluated the diagnostic models using fivefold grouped cross-validation over the complete development set of 138 circuit groups. In each iteration, four folds were used for training and the remaining fold for validation. All candidate plans associated with the same circuit were assigned to the same fold, thereby preventing circuit-level leakage and preserving the grouped ranking structure. Validation and early stopping were based on NDCG@3 computed on the validation fold of the corresponding iteration. The normalized discounted cumulative gain truncated at the top three positions (NDCG@3) measures how well the most relevant plans are placed near the top of each group. Feature selection and the learning curves were performed using five-fold grouped cross validation over the complete development set. We then subjected this initial model to standard sanity checks. In particular, we verified that performance collapsed when the labels were randomly shuffled, confirming that the predictive signal did not arise from leakage or trivial dataset artifacts. After this preliminary validation, we computed learning curves to assess the quality and generalization behavior of the initial model. These curves revealed clear signs of overfitting, with training performance continuing to improve while validation performance saturated or degraded. This diagnosis motivated the next stages of the protocol, aimed at improving robustness and reducing unnecessary model complexity. Feature selection was guided by two comple-
5.4 Model Optimization and Training This stage selects the final hyperparameters, trains the two optimized rankers, and defines the comparison baselines used in the source-backend evaluation. We optimized the XGBoost ranking models through a randomized hyperparameter search using the same five-fold grouped cross-validation protocol. The search focused on a small set of parameters with the greatest impact on model capacity and regularization: max_depth, which controls tree complexity; eta, which sets the learning rate; and lambda, alpha, and min_child_weight, which regulate model smoothness and splitting conservativeness. These parameters were explored for both the rank:ndcg and rank:pairwise objectives. Each sampled configuration was evaluated using the mean validation NDCG@3 across the five folds, with early stopping applied independently on the validation fold of each iteration to determine the appropriate number of boosting rounds. The best-performing configurations were retained as the final optimized models, whose main hyper10
whether the gains of the learned models come mainly from improving the first recommendation, from improving the ordering of the remaining plans, or from both. After feature selection and hyperparameter optimization (HPO), the selected model configurations were retrained on the full development set,i.e., all 138 groups.The resulting fixed models were then evaluated once on the locked ID and OOD sets. Their robustness and generalization are assessed experimentally through the sourcebackend and backend-shift evaluations presented in Sections 6 and 7. After completing the full experimental evaluation on the locked in-distribution and OOD splits, a separate deployment model may be retrained using all labeled data to maximize practical utility. This post-evaluation refit is intended for downstream use only and should not be interpreted with the same reported test/OOD metrics, which apply to the evaluation protocol described above.
parameters are summarized in Table 4. Our main comparison focuses on two optimized XGBoost rankers that differ only in the training objective. The first, opt_ndcg, uses rank:ndcg, whereas the second, opt_pair, uses rank:pairwise. Both models were obtained with the same protocol described above: the same data partitions, the same featureselection procedure, the same hyperparameteroptimization pipeline, and the same validation metric, NDCG@3. The comparison therefore isolates the effect of the training objective while keeping the rest of the pipeline fixed. This distinction is meaningful because the two objectives embody different ranking strategies. The rank:ndcg objective uses a LambdaMART formulation scaled toward NDCG, making it explicitly sensitive to the quality of the top part of the ranking, whereas rank:pairwise uses the original pairwise RankNet-style loss and focuses on reducing pairwise inversions. XGBoost also provides a third built-in ranking objective, rank:map, but this objective is primarily intended for binary relevance labels. Since our target is graded rather than binary, rank:ndcg and rank:pairwise are the two built-in objectives most appropriate for the present study. XGBoost does not provide a dedicated pointwise objective for grouped LTR, so the comparison is centered on the two ranking objectives that best match our task.
5.5 Experimental Platform and Software The following platform is shared by the experimental analyses in Sections 6 and 7. The RTX A6000 provides the source-backend measurements used for model development and the main evaluation, while the Tesla V100 is reserved for the backend-shift study. The primary execution environment was a high-performance computing server with two AMD EPYC 7282 processors, each providing 16 cores at a base clock frequency of 2.8 GHz, together with 256 GiB of DDR4 memory and 64 MiB of L3 cache. The NVIDIA RTX A6000 was used as the primary GPU backend to generate the labels employed during model development and to conduct all learning-curve, in-distribution, and outof-distribution experiments reported in Section 6. The NVIDIA Tesla V100 was used only for the cross-GPU analyses presented in Section 7. Measurements from the complete dataset were used to compare the GPU-specific ground-truth rankings, whereas the locked in-distribution test subset was used to evaluate the zero-shot transfer of the Ampere-trained models. The main characteristics of both GPU backends are summarized in Table 5. The simulations were implemented in Julia us-
To contextualize the performance of the learned rankers, we compare them against three baselines. The first, random, provides a lower bound by assigning the plan order uniformly at random. The second, mf_ndcg, is a hybrid baseline that forces the MinFill plan to the first position and uses opt_ndcg only to rank the remaining candidates. The third, mf_rand, also fixes MinFill at the first position but assigns the remaining plans randomly. These two MinFill-based baselines are useful because the target speedup is defined relative to the MinFill plan. As a result, they allow us to separate two effects: first, the value of allowing the learned model to challenge MinFill at the top of the ranking (by comparing opt_ndcg against mf_ndcg); and second, the value of learning a meaningful secondary ranking once MinFill is fixed at Top-1 (by comparing mf_ndcg against mf_rand). Together, these comparisons clarify 11
Table 4: Main hyperparameters of the two optimized XGBoost ranking models. A dash indicates that the parameter was not explicitly fixed and was left at the library default. L1 and L2 denote two regularization techniques to control overfitting. Parameter
opt_ndcg
opt_pair
Description
objective eval_metric maximize eta max_depth subsample colsample_bytree min_child_weight gamma lambda alpha seed
rank:ndcg ndcg@3 true 0.01 6 0.7 – – – – – 42
rank:pairwise ndcg@3 true 0.05 5 0.5 0.5 3 0.5 0.0 – 42
Training objective Validation metric Maximize evaluation metric Learning rate Maximum tree depth Fraction of samples used per tree Fraction of features sampled per tree Minimum child-node weight Minimum loss reduction for a split L2 regularization L1 regularization Random seed
Table 5: GPU specifications used in the experimental study.
Feature
NVIDIA RTX A6000
NVIDIA Tesla V100 PCIe 32GB
Architecture Release Date CUDA Cores Tensor Cores RT Cores Memory Memory Bandwidth FP32 Performance Interface Max Power Consumption
Ampere October 2020 10,752 336 (3rd Gen) 84 (2nd Gen) 48 GB GDDR6 768.0 GB/s 38.71 TFLOPS PCIe 4.0 x16 300 W
Volta March 2018 5,120 640 (1st Gen) None 32 GB HBM2 897.0 GB/s 14.13 TFLOPS PCIe 3.0 x16 250 W
based family, separating standard generalization from circuit-family shift.
ing QXTools.jl to construct the tensor networks and candidate contraction plans [46], OMEinsum.jl to execute the contractions, and CUDAenabled GPU execution. The ranking models were trained with XGBoost.jl [12, 47]. The same software stack was used on both GPU backends. Complete package versions, environment manifests, and system-configuration details will be provided in the accompanying repository.
6.1 Learning-Curve Analysis To assess the sample efficiency and generalization behavior of the two optimized models, we analyze learning curves built exclusively on the development set. We report two complementary metrics. The first is NDCG@3, which is the validation metric used throughout model selection and therefore provides the most direct view of how ranking quality evolves as additional training circuits are incorporated. The second is Regret3, a decision-oriented metric that measures the relative speedup loss incurred when the best plan within the model’s Top-3 recommendations is selected. While NDCG@3 evaluates the quality of the ranking itself, Regret3 captures the practical cost of imperfect ranking decisions. For both metrics, we report values on the training subset
6 Source-Backend Evaluation This section evaluates the learning behavior and final decision quality of the optimized rankers on the RTX A6000, the source backend used to generate their training labels. We first use learning curves to examine sample efficiency and train– validation behavior within the development data. We then evaluate the fixed models on the locked in-distribution test set and on the held-out QFT12
once feature selection and hyperparameter optimization have been applied. Second, the NDCGaware objective provides a better trade-off between ranking quality and downstream decision quality, which anticipates the stronger performance of opt_ndcg in the final test-set comparisons.
and on a held-out validation subset. Fig. 1 shows that both models maintain high NDCG@3 values throughout the experiment and low Regret3, with limited train–validation gaps after the final optimization stages. The most visible improvements occur up to roughly 40–45 training circuits, after which the curves enter a broad plateau. This behavior suggests that the selected features are already informative at moderate sample sizes and that additional data yields diminishing, although still positive, returns. The same figure also indicates that the strong overfitting observed in the earlier diagnostic models has been substantially reduced. In both optimized models, the training and validation curves remain reasonably close across the full range of dataset sizes. It would nevertheless be too strong to claim a complete absence of overfitting: a non-negligible train–validation gap remains, especially at smaller training sizes, but it stays limited and does not widen as more data are added. In terms of NDCG@3, both opt_ndcg and opt_pair achieve high validation values, indicating strong ranking quality even with relatively small development subsets. Because the curves remain close to the upper bound of the metric, the absolute gains are necessarily modest and should be interpreted as refinements near the performance ceiling rather than as large raw improvements. Within this regime, opt_ndcg follows a slightly more regular validation trajectory and tends to maintain a somewhat smaller train– validation gap. This is consistent with the fact that its training objective is directly aligned with the validation metric. The distinction becomes clearer in Regret3. For both models, regret decreases noticeably as more training circuits are added, confirming that the learned rankings become increasingly useful for practical Top-3 selection. However, opt_ndcg reaches consistently lower validation regret in the medium- and large-data regime, ending near 3 × 10−3 to 4 × 10−3 , whereas opt_pair stabilizes around 7 × 10−3 . Thus, although opt_pair remains competitive as a ranking model, opt_ndcg yields better decision quality when the final goal is to minimize the speedup loss within the Top-3 recommendations. The learning-curve analysis supports two conclusions. First, both optimized models are sample-efficient and generalize reasonably well
6.2 In-Distribution and Circuit-Family-Shift Evaluation We next compare the two optimized models, opt_ndcg and opt_pair, against the three baselines introduced above: random, mf_ndcg, and mf_rand. We first evaluate them on the standard held-out ID test split and then on a more challenging OOD domain-shift split. This twostage evaluation allows us to assess both the absolute quality of the learned rankings under standard conditions and their robustness when the test circuits differ more substantially from those seen during development. To characterize model performance, we report both hit-based and decision-oriented metrics. Top-1 and Top-3 denote the percentage of groups in which the true best plan is ranked first or appears within the first three positions, respectively. To quantify the practical cost of imperfect recommendations, we also report Regret1 and Regret3, defined as Sp1 , Sp⋆ maxi∈Top−3 Spi Regret3 = 1 − , Sp⋆ Regret1 = 1 −
(14) (15)
where Sp⋆ is the optimal speedup in the group and Sp1 is the speedup of the plan at rank 1. Lower regret therefore indicates better decision quality. Finally, we report win rate, defined as the fraction of groups in which the model’s topranked plan achieves a higher speedup than the MinFill plan, with ties counted as half a win for each side. Since mf_ndcg and mf_rand always place MinFill at rank 1, their win rate is 50% by construction. 6.2.1
In-distribution test
Table 6 reveals a clear hierarchy on the ID test split. The two optimized models substantially outperform all baselines across the main decision metrics, confirming that the selected structural 13
(a) opt_ndcg
(b) opt_pair
Figure 1: Learning curves for the two optimized models. Each subfigure reports training and validation NDCG@3 (top) and Regret3 (bottom) as a function of the number of training circuit groups. Table 6: ID test results (N = 25 circuit groups). Higher is better for Top-1, Top-3, and Win rate; lower is better for Regret1 and Regret3. Model opt_ndcg opt_pair random mf_ndcg mf_rand
Top-1 (%)
Top-3 (%)
Regret1
Regret3
Win rate
60.00 60.00 22.95 12.00 12.00
96.00 92.00 58.44 84.00 28.00
0.0141 0.0211 0.0699 0.0735 0.0735
0.0004 0.0004 0.0137 0.0025 0.0319
92.00 88.00 70.16 50.00 50.00
28% to 84%, and Regret3 drops from 0.0319 to 0.0025. This confirms that the secondary ranking still matters greatly when the user is willing to inspect a shortlist, although it cannot compensate for a systematically poor first recommendation.
features capture non-trivial patterns that generalize to unseen circuits from the same domain. The comparison between the two optimized models is also consistent with the learning-curve analysis: both achieve the same Top-1 accuracy (60%), but opt_ndcg attains better Top-3 (96% vs. 92%), lower Regret1 (0.0141 vs. 0.0211), and the same best Regret3 (0.0004). Thus, both models usually place an excellent candidate near the top of the ranking, but opt_ndcg is more reliable when only a single plan will ultimately be executed.
6.2.2
Circuit-family-shift evaluation
For the OOD evaluation, we constructed a dedicated held-out split by reserving all QFT-based circuits, across the considered qubit counts, and excluding them entirely from training, validation, and the in-distribution test set. The OOD results in Table 7 therefore measure the ability of the models to transfer to a circuit family not seen at any stage of model development. As expected, all models degrade under this domain shift. The learned rankers retain useful ranking information, but their advantage over the baselines is no longer uniform across all decision metrics. opt_ndcg provides the strongest OOD performance, achieving the best Top-1, Regret1, and Regret3 values while tying opt_pair on Top3. This indicates that it remains the most effec-
The baselines help clarify where these gains come from. The random baseline performs much worse than either optimized model in Top-1, Top3, and regret, showing that the observed gains are not due to chance. The two MinFill-based baselines are more informative still. Because they force MinFill to rank first, both inherit very poor Top-1 and Regret1, which shows that MinFill is rarely the true optimum in this setting. However, comparing mf_ndcg against mf_rand isolates the value of ordering the remaining candidates well once MinFill is fixed at the top: Top-3 rises from 14
Table 7: OOD domain-shift results (N = 62 circuit groups). Higher is better for Top-1, Top-3, and Win rate; lower is better for Regret1 and Regret3. Model opt_ndcg opt_pair random mf_ndcg mf_rand
Top-1 (%)
Top-3 (%)
Regret1
Regret3
Win rate
38.71 30.65 27.87 8.06 8.06
62.90 62.90 54.65 61.29 43.55
0.0520 0.0800 0.0775 0.0784 0.0784
0.0181 0.0234 0.0265 0.0189 0.0273
73.39 87.10 70.97 50.00 50.00
the ranking target itself changes across backends. Second, on the locked in-distribution test set, we keep the Ampere-trained models and their predicted orderings unchanged and evaluate those orderings against speedups and relevance labels recomputed from the Volta measurements. This isolates zero-shot model transfer from changes in the candidate set or test composition. The results describe one observed backend shift and should not be interpreted as evidence of general GPU portability.
tive option when the goal is to get as close as possible to the true optimum on an unseen circuit family. Taken together, Tables 6 and 7 support three conclusions. First, both learned models clearly outperform the random and MinFill-based baselines in the standard ID setting. Second, opt_ndcg provides the strongest overall trade-off between ranking quality and decision quality, especially when a single recommendation must be trusted. Third, the OOD experiment confirms that transfer performance is sensitive to the heldout circuit family: although the learned rankers retain useful predictive signal, the degradation from in-distribution to OOD indicates that generalization quality depends noticeably on which family is excluded during development. In our case, holding out QFT-based circuits provides a demanding but still single-family domain-shift test, so these results should be interpreted as evidence of non-trivial sensitivity to unseen circuit structure rather than as a definitive limitation of the feature set. This suggests that broader training distributions and additional family-level hold-out experiments would be valuable in future work.
7.1 Ground-Truth Ranking Stability Across GPUs Before evaluating model transfer, we first examine whether changing the GPU alters the ranking target itself. This analysis uses all 225 circuit groups in the dataset and does not involve model predictions. For each circuit, the same set of successfully measured candidate plans were executed on the RTX A6000 and the Tesla V100, and the two empirical rankings were obtained from the corresponding execution measurements. We compare the complete rankings using Kendall’s τb [48], computed independently within each circuit group. This coefficient measures pairwise ordinal agreement and accounts for ties: a value of 1 corresponds to identical orderings, whereas lower values indicate that more pairwise preferences change between GPUs. To quantify the sampling variability of the aggregate cross-GPU stability measures, we computed 95% percentile-bootstrap confidence intervals by resampling complete circuit groups. For each of B = 10,000 bootstrap replicates, N = 225 groups were sampled with replacement from the observed dataset, and the mean Kendall’s τb , same-best-plan rate, and mean Top-3 overlap were recomputed. The interval endpoints were defined by the 2.5th and 97.5th percentiles of the resulting bootstrap distribution. Resampling was
7 Backend-Shift Evaluation Section 6 evaluated the rankers on the RTX A6000, which also supplied the measurements used during model development. This section examines what changes when the same candidate plans are executed on the Tesla V100 and asks whether the Ampere-trained rankings remain useful without retraining or target-backend calibration. The study separates two questions. First, using all circuit groups, we compare the empirical rankings obtained by executing the same candidate plans on both GPUs, which shows how much 15
Table 9: Stability of the decision-relevant part of the rankings across the 225 circuit groups.
Table 8: Summary of Kendall’s τb across the 225 circuit groups. Statistic
Value
95% CI
Mean Median Standard deviation Minimum Maximum
0.845 1.000 0.273 -0.143 1.000
[0.808, 0.878] [1.000, 1.000] — — —
(3)
Ov3,g =
,
G 1 X Ov3,g . G g=1
Same-best-plan rate Mean Top-3 set overlap
84.0% 89.63%
[79.1%, 88.4%] [87.1%, 92.0%]
Stability also differs across circuit families, as reported in Table 10. Quantum Walk circuits retain exactly the same rankings on both devices, while Grover and GHZ circuits also show high agreement. RQC circuits occupy an intermediate position, and the lower values for the QFT-based family indicate greater sensitivity to the backend.
(16)
and the value reported in Table 9 is its mean across the G circuit groups, Ov3 =
95% CI
Agreement is slightly weaker when only the fastest plan is considered. The two GPUs select the same best plan in 84% of the circuits, so local exchanges near the top of the ranking occur more often than complete changes in ranking structure. The mean Top-3 set overlap is 89.63%, corresponding to an average of 2.69 shared plans out of three per circuit. The short list of competitive plans is therefore more stable than the identity of the single fastest plan, which is useful when several recommendations can be tested on the target GPU.
(3)
3
Mean
of the circuit groups retain the complete ordering of their common candidate plans. The lower values found in some groups show that this stability is not universal and that the backend can substantially reorder the candidates in particular cases.
performed at the circuit-group level (base_id), rather than at the level of individual contraction plans, to preserve the dependence among candidate plans retained for the same circuit. The random seed was fixed to 42 for reproducibility. These intervals quantify variability across circuit groups under the assumption that the observed dataset is representative of the broader population of circuits of interest; they do not account for timing-measurement uncertainty or for changes in circuit-family composition. Table 8 summarizes the distribution of the resulting coefficients. The upper part of the ranking is examined separately because it is the most relevant region for (3) (3) plan selection. Let Ig,A and Ig,B denote the unordered sets of the three fastest plans for circuit g on the two GPUs. The Top-3 set overlap for that circuit is Ig,A ∩ Ig,B
Metric
A plausible explanation is that the regular contraction structures produced by QWALK and GHZ circuits leave less room for hardwaredependent trade-offs to change the ordering. More heterogeneous plans may contain closer balances between computational work, reduction size, parallelism, contraction geometry, and memory traffic, allowing architectural differences to affect their relative execution times. The present experiment does not isolate these factors, so this interpretation should not be treated as a causal result.
(17)
The order of the plans within each Top-3 set is ignored. Thus, a circuit contributes 1, 2/3, 1/3, or 0, depending on whether the two GPUs share three, two, one, or none of their three fastest plans. The same-best-plan rate is stricter at the first position and measures the fraction of circuits for which both GPUs identify the same fastest plan. The results in Tables 8 and 9 indicate that most pairwise preferences are preserved when moving from Ampere to Volta, although the degree of stability varies among circuits. The mean τb is 0.85, while the median of 1.0 means that at least half
This analysis shows how much the empirical ranking target changes between the two GPUs. It does not establish whether the Ampere-trained models still make good recommendations on Volta, which is evaluated separately in the next subsection. 16
Table 10: Ground-truth ranking stability by circuit family. Family
N
Mean τb
Same-best-plan rate
Top-3 overlap
GHZ Grover QNN Quantum Walk RQC VQE Deutsch–Jozsa Ground State Pricing Call Portfolio QAOA QFT-based
18 7 24 5 86 7 3 1 11 1 62
0.958 0.959 0.879 1.000 0.874 0.864 0.778 1.000 0.931 1.000 0.710
94.4% 85.7% 87.5% 100.0% 88.4% 85.7% 100.0% 100.0% 90.9% 100.0% 69.4%
96.3% 95.2% 93.1% 100.0% 91.9% 95.2% 88.9% 100.0% 97.0% 100.0% 79.6%
of its highest-ranked candidates better under the observed backend shift. The comparison involves only one target architecture, however, and does not establish that the NDCG-oriented objective is generally more robust across GPUs.
7.2 Zero-Shot Model Transfer under GPU Backend Shift We next examine whether the rankers trained from Ampere measurements remain useful when plan quality is determined by execution on Volta. This evaluation uses the same 25 circuit groups and the same candidate plans as the locked indistribution test. The models are not retrained or calibrated for the target GPU. Since their input features depend only on the contraction plans, the feature vectors and predicted rankings remain unchanged; only the runtimes, MinFill-relative speedups, and relevance labels used to evaluate those predictions are recomputed from the Volta executions. Table 11 compares the decision quality of both rankers when their fixed predictions are evaluated against the Ampere and Volta ground truths. Top-1, Top-3, Regret1, Regret3, and win rate are computed in the same way as in the earlier in-distribution evaluation, with MinFill executed separately on each backend. Both models retain a high Top-3 rate on Volta, with a decrease of four percentage points in each case. The shortlists obtained from the structural plan features therefore remain useful after the backend change. The increase in regret reveals a loss that Top-3 alone does not capture: when the fastest plan is absent from the shortlist, the best available recommendation can be farther from the optimum on Volta. The NDCG-oriented model is less affected in this experiment. Its Regret1 increases from 0.014 to 0.025, whereas the pairwise model rises from 0.021 to 0.053. Regret3 follows the same pattern. This suggests that opt_ndcg preserves the quality
The Top-1 rate of opt_ndcg increases from 60% to 64%, while that of opt_pair decreases to 52%. The increase for opt_ndcg corresponds to one additional correct circuit among the 25 test groups and should not be interpreted as an improvement caused by the change of GPU. With a small test set, an exchange between two closely performing plans can change the Top-1 result for an entire circuit without representing a broad improvement in ranking quality. The win rate remains unchanged for both models: 92% for opt_ndcg and 88% for opt_pair. Their first recommendations therefore continue to outperform the backend-specific MinFill plan in a similar proportion of test circuits. Identical aggregate percentages do not necessarily mean that the models win on the same circuits on both GPUs. The fixed Ampere-trained rankings retain useful decision quality when assessed with Volta measurements, particularly when three candidate plans can be tested. The higher regret also shows that the backend change is not neutral and that the relative cost of a wrong recommendation can increase even when Top-3 and win rate remain high. This experiment provides evidence for zeroshot transfer between the two NVIDIA architectures considered here, not for general independence from the hardware and software backend. 17
Table 11: Zero-shot cross-GPU performance on the locked in-distribution test set (N = 25). Both models were trained using Ampere measurements. The evaluation backend determines the runtimes, speedups, and relevance labels used to assess the fixed model predictions. Model
Evaluation backend
Top-3 (%)
Regret3
Top-1 (%)
Regret1
Win rate (%)
opt_ndcg opt_ndcg
Ampere Volta
96.0 92.0
0.0004 0.0068
60.0 64.0
0.0141 0.0254
92.0 92.0
opt_pair opt_pair
Ampere Volta
92.0 88.0
0.0004 0.0125
60.0 52.0
0.0211 0.0531
88.0 88.0
therefore transfer to some extent across these two architectures, but the observed backend shift is too limited to support a general claim of hardware independence. In practice, the method can reduce the candidate set to one plan or a short list that is then measured on the target GPU. Its usefulness still depends on the quality and diversity of the plans supplied to the ranker; the method selects among existing candidates rather than generating new contraction orders. Our next step is to generate substantially larger and more varied candidate sets for each circuit, increasing both the dataset size and the range of plan structures represented in it. This will make it possible to study how ranking quality changes as the candidate pool grows. We also plan a stricter domain-shift experiment in which complete plan-generation methods or heuristic families are withheld from training and validation. In a later stage, we intend to include more distinct GPU backends and investigate rankers conditioned on descriptors of the target hardware and software stack, possibly supported by a small calibration set. That extension will depend on the portability of QXTools and its current CUDA-based environment.
8 Conclusions The aim of this study was to select efficient contraction plans for GPU-based quantum circuit simulation without executing every candidate beforehand. We treated this as a ranking problem: for this application, identifying a good plan or a useful shortlist matters more than predicting exact runtimes. The rankers use structural descriptors extracted directly from the sequence of contractions. These features capture properties related to computational load, parallelism, reductions, contraction geometry, and plan granularity, but require no preliminary execution or profiling on the GPU. The resulting model can therefore be placed between plan generation and execution as a low-cost selection stage. The experiments show that this representation contains enough information to distinguish useful plans. On the locked in-distribution test, the NDCG-oriented model placed the fastest plan first in 60% of the circuits and within its first three recommendations in 96%, with a mean Regret1 of 0.0141. It gave the best balance between Top-k accuracy and decision regret among the models considered. When the complete QFTbased family was excluded from model development, its Top-3 rate fell to 62.9%. The drop is substantial, but the model still retained useful predictive information for a circuit family it had not seen during training or validation. The cross-GPU results show a similar mixture of stability and change. Across the full dataset, Ampere and Volta selected the same fastest plan in 84% of the circuits, and their sets of three fastest plans had a mean overlap of 89.6%. On the locked test set, the Ampere-trained NDCG model retained a Top-3 rate of 92% when evaluated with Volta measurements, although its regret increased. Structural properties of the plans
Author Contributions A.M.P.: Software, Investigation, and Visualization. M.C. and J.M.B.: Supervision and Funding acquisition. All authors: Conceptualization, Methodology, Validation, Writing – original draft, and Writing – review & editing. All authors discussed the results, approved the final version of the manuscript, and take responsibility for its content. ChatGPT (OpenAI) and Gemini (Google) were used as writing assistants for language editing, structural suggestions, and bibliographic and for18
Journal of Experimental Algorithmics 23, 1– 34 (2018). [8] NVIDIA Corporation. “cuQuantum tensor network contraction documentation”. (2024). url: https://docs.nvidia. com/cuda/cuquantum/24.11/python/ tensornet-contraction.html. [9] NVIDIA Corporation. “cuTENSOR user guide”. (2025). url: https: //docs.nvidia.com/cuda/cutensor/ latest/user_guide.html. [10] Tie-Yan Liu. “Learning to rank for information retrieval”. Volume 3 of Foundations and Trends in Information Retrieval, pages 225– 331. Now Publishers. (2009). [11] Gavin S. Hartnett, Aaron Barbosa, Pranav S. Mundada, Michael Hush, Michael J. Biercuk, and Yuval Baum. “Learning to rank quantum circuits for hardware-optimized performance enhancement”. Quantum 8, 1542 (2024). arXiv:2404.06535. [12] Tianqi Chen and Carlos Guestrin. “XGBoost: A scalable tree boosting system”. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (KDD). Pages 785– 794. New York, NY, USA (2016). ACM. [13] Maria Schuld and Francesco Petruccione. “Machine learning with quantum computers”. Volume 676 of Quantum Science and Technology. Springer. Cham, Switzerland (2021). 1st edition. [14] Kamila Zaman, Alberto Marchisio, Muhammad Abdullah Hanif, and Muhammad Shafique. “A survey on quantum machine learning: Current trends, challenges, opportunities, and the road ahead” (2023). arXiv:2310.10315. [15] Johannes Bausch, Andrew W. Senior, Francisco J. H. Heras, Thomas Edlich, Alex Davies, Michael Newman, Cody Jones, Kevin Satzinger, Murphy Yuezhen Niu, Sam Blackwell, George Holland, Dvir Kafri, Juan Atalaya, Craig Gidney, Demis Hassabis, Sergio Boixo, Hartmut Neven, and Pushmeet Kohli. “Learning high-accuracy error decoding for quantum processors”. Nature 635, 834–840 (2024). [16] M. S. Kazemi, Z. Bakhshinezhad, and A. T. Rezakhani. “Support vector machines for
mal review. All scientific claims, numerical results, interpretations, software, experimental results, and final wording were verified and approved by the authors, who take full responsibility for the manuscript.
Data and Code Availability The circuit instances, candidate contraction plans, measured execution times, featureextraction scripts, and analysis code supporting this study will be made available in a public repository upon publication.
Acknowledgments This work was supported by the research project PID2023-146569NB-C22 funded by MCIN/AEI/10.13039/501100011033 and “ERDF A way of making Europe”.
References [1] Igor L. Markov and Yaoyun Shi. “Simulating quantum computation by contracting tensor networks”. SIAM Journal on Computing 38, 963–981 (2008). [2] Román Orús. “A practical introduction to tensor networks: Matrix product states and projected entangled pair states”. Annals of Physics 349, 117–158 (2014). [3] Johnnie Gray and Stefanos Kourtis. “Hyperoptimized tensor network contraction”. Quantum 5, 410 (2021). [4] Robert N. C. Pfeifer, Jutho Haegeman, and Frank Verstraete. “Faster identification of optimal contraction sequences for tensor networks”. Physical Review E 90, 033315 (2014). [5] Hajo J. Broersma, Elias Dahlhaus, and Ton Kloks. “A linear time algorithm for minimum fill-in and treewidth for distance hereditary graphs”. Discrete Applied Mathematics 99, 367–400 (2000). [6] Michelle Girvan and Mark E. J. Newman. “Community structure in social and biological networks”. Proceedings of the National Academy of Sciences 99, 7821–7826 (2002). [7] Michael Hamann and Ben Strasser. “Graph bisection with pareto optimization”. ACM 19
[26] Junior Zilles, Giancarlo Lucca, and Eduardo Nunes Borges. “A literature review on methods for learning to rank”. In Proceedings of the 24th International Conference on Enterprise Information Systems, Volume 1 (ICEIS). Pages 545–552. INSTICCSciTePress (2022). [27] Tingting Li, Ziming Zhao, and Jianwei Yin. “Empowering quantum serverless circuit deployment optimization via graph contrastive learning and learning-to-rank co-designed approaches”. In Proceedings of the ThirtyFourth International Joint Conference on Artificial Intelligence (IJCAI). Pages 9250– 9258. International Joint Conferences on Artificial Intelligence Organization (2025). [28] Vicente Lopez-Oliva, Jose M. Badia, and Maribel Castillo. “Efficient quantum circuit contraction using tensor decision diagrams”. The Journal of Supercomputing 81, 354 (2025). [29] Bryan O’Gorman. “Parameterization of tensor network contraction”. In 14th Conference on the Theory of Quantum Computation, Communication and Cryptography (TQC 2019). Volume 135 of Leibniz International Proceedings in Informatics (LIPIcs), pages 10:1–10:19. Schloss Dagstuhl – Leibniz-Zentrum fuer Informatik (2019). [30] Paul Springer and Paolo Bientinesi. “Design of a high-performance GEMM-like tensortensor multiplication”. ACM Transactions on Mathematical Software 44, 1–29 (2018). [31] Devin A. Matthews. “High-performance tensor contraction without transposition”. SIAM Journal on Scientific Computing 40, C1–C24 (2018). [32] Benjamin Villalonga, Sergio Boixo, Bron Nelson, Christopher Henze, Eleanor Rieffel, Rupak Biswas, and Salvatore Mandrà. “A flexible high-performance simulator for verifying and benchmarking quantum circuits implemented on real hardware”. npj Quantum Information 5, 86 (2019). [33] Eugene F. Dumitrescu, Allison L. Fisher, Timothy D. Goodrich, Travis S. Humble, Blair D. Sullivan, and Andrew L. Wright. “Benchmarking treewidth as a practical component of tensor network simulations”. PLOS ONE 13, e0207827 (2018). [34] Ben Strasser. “Computing tree decomposi-
quantum state tomography”. Physical Review A 101, 042307 (2020). [17] Y. Wang, L. Zhang, Q. Wang, and Z. Liu. “Support vector machine classification of topological phase transitions”. Physical Review B 99, 115105 (2019). [18] Nils Quetschlich, Lukas Burgholzer, and Robert Wille. “Predicting good quantum circuit compilation options”. In Proceedings of the 2023 IEEE International Conference on Quantum Software (QSW). Pages 43–53. IEEE (2023). arXiv:2210.08027. [19] G. Torlai, G. Mazzola, J. Carrasquilla, M. Troyer, R. Melko, and G. Carleo. “Neural-network quantum state tomography”. Nature Physics 14, 447–450 (2018). [20] Guillaume Verdon, Michael Broughton, and Jacob Biamonte. “Learning to learn with quantum neural networks via classical neural networks” (2019). arXiv:1907.05415. [21] Justin Lee, Gabriel Bernier-Colborne, Tegan Maharaj, and Sowmya Vajjala. “Methods, applications, and directions of learning-torank in NLP research”. In Kevin Duh, Helena Gomez, and Steven Bethard, editors, Findings of the Association for Computational Linguistics: NAACL 2024. Pages 1900–1917. Mexico City, Mexico (2024). Association for Computational Linguistics. [22] Md. Ahsanul Kabir, Mohammad Al Hasan, Aritra Mandal, Daniel Tunkelang, and Zhe Wu. “A survey on e-commerce learning to rank” (2024). arXiv:2412.03581. [23] Aditya Gaydhani, Guangyue Xu, Dhanush Kamath, Ankit Singh, and Alex Li. “Unified learning-to-rank for multi-channel retrieval in large-scale e-commerce search” (2026). arXiv:2602.23530. [24] Sebastian Bruch, Claudio Lucchese, and Franco Maria Nardini. “Efficient and effective tree-based and neural learning to rank”. Foundations and Trends in Information Retrieval 17, 1–131 (2023). [25] Shashank Gupta, Philipp Hager, Jin Huang, Ali Vardasbi, and Harrie Oosterhuis. “Recent advances in the foundations and applications of unbiased learning to rank”. In Proceedings of the 46th International ACM SIGIR Conference on Research and Development in Information Retrieval. Pages 3440– 3443. ACM (2023). arXiv:2305.02914. 20
tions with FlowCutter: PACE 2017 submission” (2017). arXiv:1709.08949.
view/introduction-to-machine/ 9781449369880/. [43] Rory Mitchell, Eibe Frank, and Geoffrey Holmes. “Accelerating the XGBoost algorithm using GPU computing”. PeerJ Computer Science 3, e127 (2018). [44] Kshitij Goyal, Sebastijan Dumančić, and Hendrik Blockeel. “Feature interactions in XGBoost” (2020). arXiv:2007.05758. [45] Scott M Lundberg and Su-In Lee. “A unified approach to interpreting model predictions”. In I. Guyon, U. Von Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett, editors, Advances in Neural Information Processing Systems 30. Pages 4765–4774. Curran Associates, Inc. (2017). [46] John Brennan, Lee O’Riordan, Kenneth Hanley, Myles Doyle, Momme Allalen, David Brayford, Luigi Iapichino, and Niall Moran. “QXTools: A Julia framework for distributed quantum circuit simulation”. Journal of Open Source Software 7, 3711 (2022). [47] XGBoost.jl Contributors. “XGBoost.jl: Julia interface to XGBoost”. https://github.com/dmlc/XGBoost.jl/ releases/tag/v2.5.3 (2026). Version 2.5.3, accessed 5 August 2026. [48] M. G. Kendall and J. D. Gibbons. “Rank correlation methods”. Oxford University Press. New York (1990). 5th edition. url: https:// search.worldcat.org/title/21195423. [49] Cupjin Huang, Fang Zhang, Michael Newman, Xiaotong Ni, Dawei Ding, Junjie Cai, Xun Gao, Tenghui Wang, Feng Wu, Gengyan Zhang, Hsiang-Sheng Ku, Zhengxiong Tian, Junyin Wu, Haihong Xu, Huanjun Yu, Bo Yuan, Mario Szegedy, Yaoyun Shi, Hui-Hai Zhao, Chunqing Deng, and Jianxin Chen. “Efficient parallelization of tensor network contraction for simulating quantum computation”. Nature Computational Science 1, 578–587 (2021). [50] Trevor Vincent, Lee J. O’Riordan, Mikhail Andrenkov, Jack Brown, Nathan Killoran, Haoyu Qi, and Ish Dhand. “Jet: Fast quantum circuit simulations with parallel taskbased tensor-network contraction”. Quantum 6, 709 (2022). [51] Feng Pan, Hanfeng Gu, Lvlin Kuang, Bing Liu, and Pan Zhang. “Efficient quantum cir-
[35] Mark E. J. Newman and Michelle Girvan. “Finding and evaluating community structure in networks”. Physical Review E 69, 026113 (2004). [36] Chris Burges, Tal Shaked, Erin Renshaw, Ari Lazier, Matt Deeds, Nicole Hamilton, and Greg Hullender. “Learning to rank using gradient descent”. In Proceedings of the 22nd International Conference on Machine Learning (ICML). Pages 89–96. New York, NY, USA (2005). ACM. [37] Christopher J. C. Burges. “From RankNet to LambdaRank to LambdaMART: An overview”. Technical Report MSR-TR-201082. Microsoft Research (2010). [38] Pinar Heggernes. “Minimal triangulations of graphs: A survey”. Discrete Mathematics 306, 297–317 (2006). [39] Jean R. S. Blair and Barry W. Peyton. “An introduction to chordal graphs and clique trees”. In Alan George, John R. Gilbert, and Joseph W. H. Liu, editors, Graph Theory and Sparse Matrix Computation. Volume 56 of The IMA Volumes in Mathematics and its Applications, pages 1–29. Springer, New York, NY, USA (1993). [40] Nils Quetschlich, Lukas Burgholzer, and Robert Wille. “MQT Bench: Benchmarking software and design automation tools for quantum computing”. Quantum 7, 1062 (2023). [41] Holger Dell, Christian Komusiewicz, Nimrod Talmon, and Mathias Weller. “The PACE 2017 Parameterized Algorithms and Computational Experiments Challenge: The Second Iteration”. In Daniel Lokshtanov and Naomi Nishimura, editors, 12th International Symposium on Parameterized and Exact Computation (IPEC 2017). Volume 89 of Leibniz International Proceedings in Informatics (LIPIcs), pages 30:1–30:12. Dagstuhl, Germany (2018). Schloss Dagstuhl–LeibnizZentrum fuer Informatik. [42] Andreas C. Müller and Sarah Guido. “Introduction to machine learning with python: A guide for data scientists”. O’Reilly Media. Sebastopol, CA, USA (2016). 1st edition. url: https://www.oreilly.com/library/ 21
[54] Aleksandr Berezutskii, Minzhao Liu, Atithi Acharya, et al. “Tensor networks for quantum computing”. Nature Reviews Physics 7, 581–593 (2025).
cuit simulation by tensor network methods on modern GPUs”. ACM Transactions on Quantum Computing 5, 26:1–26:25 (2024). [52] Alfred M. Pastor, Maribel Castillo, and Jose M. Badia. “Parallel tensor network contraction for efficient quantum circuit simulation on multicore CPUs and GPUs”. In Proceedings of the 1st International Conference on Quantum Software (IQSOFT 2025). Pages 120–127. SCITEPRESS (2025). [53] Alfred M. Pastor, Jose M. Badia, and Maribel Castillo. “A community detection-based parallel algorithm for quantum circuit simulation using tensor networks”. The Journal of Supercomputing 81, 450 (2025).
[55] Samuel Williams, Andrew Waterman, and David Patterson. “Roofline: An insightful visual performance model for multicore architectures”. Communications of the ACM 52, 65–76 (2009). [56] QuantumKitHub. “TensorOperations.jl documentation”. (2025). url: https://quantumkithub.github. io/TensorOperations.jl/stable/.
A Detailed cost model and feature-block definitions This appendix provides the technical detail underlying the feature design summarized in Section 4. The aim is not to reproduce the internal cost model of a specific tensor-contraction library, but to define portable structural predictors that can be computed directly from a contraction plan before execution and that remain informative for GPU runtime. The starting point is the well-known observation that contraction cost is highly sensitive to path structure and that width-based reasoning, i.e., reasoning based on contraction width and related bottleneck-size proxies, while essential, is not sufficient to explain measured performance on current CPU/GPU tensor-network simulators [1, 3, 29, 33].
A.1 Why width alone is not sufficient Width-based theory explains why contraction order matters: simulation complexity is tightly linked to graph structure and, in particular, to treewidth-related notions of difficulty [1, 29, 33]. In the quantum-circuit setting, this connection is also borne out empirically: treewidth-oriented path search is often a strong practical proxy for contraction difficulty, although its effectiveness depends on the network family and on the optimization budget [3, 33]. However, for feature engineering, width alone is not enough. Two plans with comparable leading width can still differ substantially in total work, local intermediate sizes, contraction-shape regularity, and parallel efficiency. This is especially important in current tensor-network simulators, where efficient execution relies on parallel tensor contractions on multicore CPUs and, increasingly, on GPUs [49–54]. From the point of view of execution, the dominant factors are not only the computational burden of the bottleneck step, but also the amount of output-side parallelism, the reduction structure that governs reuse and arithmetic intensity, the geometry of the equivalent dense kernel, and the overhead induced by fragmented plans. This is consistent with Roofline-style reasoning, which makes explicit that achievable performance depends on the balance between arithmetic throughput and bandwidthlimited throughput rather than on FLOPs alone [55]. Consequently, the cost model used to build the feature space must be actionable: it must be computable directly from the contraction plan before execution, yet expressive enough to reflect the structural properties that determine actual runtime on the target hardware.
A.2 Local contraction model Consider again the i-th binary contraction step Oi = contractSi (Ai , Bi ), 22
where Si is the set of shared indices eliminated in the contraction. For binary tensor networks, ki = |Si |, mi = rank(Ai ) − ki , ni = rank(Bi ) − ki , so that mi and ni count the free indices inherited from Ai and Bi , respectively, and rank(Oi ) = mi + ni . After a suitable permutation of modes, every pairwise contraction can be expressed in the GEMMlike form introduced in Eq. (5). This abstraction is not merely pedagogical: it is exactly the type of decomposition exploited by modern tensor-contraction libraries, whether through explicit transpose– GEMM strategies, fused packing-and-contraction schemes, or native tensor kernels [9, 30, 31, 56]. It therefore provides a natural basis for feature design.
A.3 Step-level primitives and their interpretation At step level, we work with four primitives: ci = mi + ni + ki , pi = mi + ni , ki = |Si |, |mi − ni | di = , mi + n i + ε
ε ≪ 1.
These four quantities form the irreducible basis of the feature space. The first quantity, ci , is the work exponent. For binary networks, the equivalent FLOP count satisfies FLOPsi = Θ(2M N K) = Θ(21+ci ),
(18)
so ci is the natural logarithmic proxy for local computational effort. It is the closest step-level quantity to the classical complexity surrogates traditionally used in contraction-path search. If one only wanted a combinatorial estimate of difficulty, ci would be the natural first candidate. The second quantity, pi , is the output-size exponent. Since |Oi | = 2pi , it has a dual interpretation. In the sequential regime it is a proxy for the immediate intermediate tensor size and hence for memory pressure, temporary workspace demand, and downstream data movement. In the parallel regime, because the output contains M N = 2pi elements, it also acts as a proxy for exploitable data parallelism. This is why it is preferable to expose pi explicitly rather than absorb it into a more opaque memory surrogate. The third quantity, ki , is the reduction exponent. Although it appears inside ci , it captures a different structural aspect of the contraction. Two steps with the same ci can have very different balances between output formation and inner reduction, and therefore very different reuse profiles. In Roofline terms, ki influences whether the step is more likely to be compute-bound or memorybound [55]. This is also consistent with practice in GPU tensor contraction, where higher useful reuse and Tensor-Core-friendly structure are repeatedly identified as central to performance [9, 51]. The fourth quantity, di , is a geometry descriptor. Values near zero correspond to roughly square contractions, whereas values near one indicate tall-and-skinny or short-and-wide cases. This distinction matters because optimized dense kernels are not shape-invariant: highly imbalanced contractions are more likely to suffer from poorer locality, weaker packing efficiency, less favorable stride structure, and lower sustained throughput [9, 30, 31]. Thus, di acts as a compact surrogate for contraction geometry and mapping quality. 23
A minimal backend-agnostic proxy for data movement also follows from the GEMM-like form: Bytesmin = Θ(M K + KN + M N ). i This expression clarifies why separating pi and ki is meaningful: steps with similar FLOP counts can still differ substantially in output size, reduction depth, and therefore in the balance between computation and memory traffic.
A.4 Plan-level aggregation A contraction plan π with S pairwise contractions is a variable-length sequence of local descriptors. To use it in a tabular learning model, we map it to a fixed-size vector through aggregations that preserve the physically relevant structure of the plan. Simple averages are rarely sufficient. In practical tensornetwork contractions, total runtime is often dominated by one or a few expensive steps, while the long tail of small steps contributes mainly through overhead, intermediate materialization, or cache- and kernel-unfriendly fragmentation [3, 29]. We therefore define the bottleneck exponent cmax = max ci , i
Imax = {i : ci = cmax },
(19)
and FLOP-proportional weights
2ci −cmax wi = PS . cℓ −cmax ℓ=1 2 The subtraction of cmax is only for numerical stability; it does not change the weighting. The resulting features are grouped into blocks that capture distinct hypotheses about what limits runtime. These blocks are not arbitrary. They are designed to represent the dominant work region, the distribution of costs beyond the single bottleneck, and structural overhead effects that asymptotic complexity tends to ignore.
A.5 Complexity and critical-load block The first aggregation block captures the overall computational burden of the plan together with the structure of its bottleneck region. It includes max_cost(π) = cmax , log2_sum_flops(π) = log2
(20) S X
!
2 ci ,
(21)
i=1
topq_mean_cost(π) =
1 X ci , |Iq | i∈I
(22)
q
where Iq denotes the set of indices corresponding to the ⌈qS⌉ largest values of ci , together with S 1X avg_cost(π) = ci , S i=1
(23)
std_cost(π) = std(ci ).
(24)
These descriptors are correlated but not redundant. max_cost is the direct descendant of widthbased reasoning and tracks the dominant contraction. log2_sum_flops moves beyond the leading term and measures total accumulated work. topq_mean_cost captures whether the plan is dominated by one isolated critical step or by a broader near-critical tail. This distinction is important in practice because a plan with many almost-maximal steps can behave quite differently from a plan with one sharp peak and a cheap remainder. Finally, avg_cost and std_cost summarize the global level and heterogeneity of the cost profile: a high standard deviation indicates a very uneven plan, whereas a lower value indicates a more homogeneous contraction sequence. 24
A.6 Sequence and granularity block The second block captures structural fragmentation: n_steps(π) = S, frac_tiny_steps(π) =
S 1X 1{ci ≤ cmax − τ }, S i=1
(25) (26)
where τ is a fixed threshold, e.g. τ = 6, so that a “tiny” step is at least 26 = 64 times smaller in FLOP scale than the bottleneck. These variables matter because asymptotic work models ignore granularity. A plan can have a reasonable bottleneck and moderate total work, yet still perform poorly if it decomposes the contraction into too many very small operations. Such a plan tends to amplify loop and scheduling overhead, increase the number of intermediate tensors that must be created and consumed, and reduce the opportunity for sustained high-efficiency execution. In this sense, n_steps measures structural fragmentation, while frac_tiny_steps identifies whether that fragmentation is concentrated in an extended tail of low-value operations.
A.7 GPU-oriented refinement At this point, the sequential feature space already captures the main classical determinants of cost: bottleneck difficulty, total work, workload dispersion, and plan granularity. However, selecting a good plan for GPUs requires a more refined view of how each step maps to parallel hardware. Modern tensornetwork simulators increasingly rely on multicore and GPU backends because pairwise contractions expose large amounts of data parallelism and can often be executed through GEMM-like kernels [49– 53]. On such hardware, runtime is not a monotone function of FLOPs. The Roofline model makes this explicit: achievable performance is bounded by the minimum of peak arithmetic throughput and bandwidth-limited throughput, so kernels with similar FLOP counts may fall into very different execution regimes depending on their arithmetic intensity [55]. For the local contraction in Eq. (5), an intensity proxy is Ii ≈
2M N K . M K + KN + M N
(27)
For fixed M and N , the dominant driver of Ii is K = 2ki . This is why ki is promoted from an internal term in ci to an explicit feature: it separates high-reuse, compute-friendly contractions from low-reuse, memory-sensitive ones. The variable pi also acquires a second interpretation in the GPU regime. Since the output contains M N = 2pi elements, pi becomes a direct proxy for exploitable data parallelism: a large pi offers many independent output elements to distribute across threads and thread blocks, whereas a very small pi is more likely to underutilize the device even if the theoretical work exponent is large. The geometry descriptor di is equally important. High-performance tensor libraries stress that memory layout and stride regularity are critical for performance. On CPUs, fused packing and transposeavoidance are used to recover favorable access patterns [30, 31]. On GPUs, the same issue appears as a requirement to align mode ordering across tensors, to keep batched modes in slow-varying dimensions, and to preserve a large stride-one extent whenever possible [9]. This is why di matters: it is a compact surrogate for how square or skinny the effective M × N geometry is, and therefore for how easily the step can be mapped to a high-throughput kernel. 25
A.8 Parallelism-dynamics block This block summarizes how much useful output-side parallelism is present in the plan, globally and at the bottleneck: max_out_rank(π) = max pi ,
(28)
1X pi , S i
(29)
X
(30)
i
avg_out_rank(π) = costw_out_rank(π) =
wi p i ,
i
p_at_max_cost(π) =
1
X
|Imax | i∈I
pi .
(31)
max
Each of these quantities answers a slightly different question. max_out_rank tells us how much output parallelism is ever exposed by the plan and also acts as a rough proxy for the largest immediate intermediate tensor. avg_out_rank summarizes the typical output scale of the plan, which is useful when discriminating between consistently parallel-friendly plans and those that only occasionally expose large outputs. costw_out_rank is more selective: it asks whether the expensive part of the plan is also the parallel-rich part. This distinction is crucial because large output tensors in cheap steps do little to accelerate total runtime if the bottleneck itself remains poorly parallelized. Finally, p_at_max_cost isolates that exact issue by measuring output parallelism at the critical step.
A.9 Reduction and arithmetic-intensity block This block isolates whether the heavy contractions of the plan are reduction-rich or reduction-poor: max_red_rank(π) = max ki ,
(32)
i
costw_red_rank(π) =
X
wi ki ,
(33)
i
k_at_max_cost(π) =
1
X
|Imax | i∈I
ki .
(34)
max
The purpose of this block is to make arithmetic intensity visible at plan level. max_red_rank records the largest reduction dimension encountered anywhere in the path. On its own, that feature says little about total runtime, but it does indicate whether the plan contains potentially high-reuse contractions. costw_red_rank is more informative because it measures the reduction-richness of the expensive region rather than of the path as a whole. k_at_max_cost goes one step further and characterizes the bottleneck directly. Plans with similar max_cost can differ markedly in k_at_max_cost, and therefore in whether their dominant contraction is more likely to be compute-bound or memory-bound.
A.10 Geometry and memory-access block This block summarizes contraction shape both globally and at the bottleneck: max_asym(π) = max di ,
(35)
1X di , S i
(36)
X
(37)
i
avg_asym(π) = costw_asym(π) =
wi di ,
i
d_at_max_cost(π) =
26
1
X
|Imax | i∈I
max
di .
(38)
These descriptors become particularly important when two plans have similar bottleneck FLOP exponents but very different effective GEMM geometries. max_asym identifies whether the plan ever enters an extremely unbalanced regime. avg_asym measures the overall geometric tendency of the path. costw_asym asks whether the expensive part of the plan is also the geometrically awkward part, and d_at_max_cost makes that question explicit at the bottleneck. Their common justification is that shape regularity is a first-order determinant of memory-access quality and kernel efficiency, particularly on GPUs where stride structure, packing efficiency, and Tensor Core utilization are strongly shapedependent [9, 30, 31].
A.11 Kernel-management and overhead block The previously introduced features n_steps and frac_tiny_steps remain relevant here, but their interpretation sharpens on GPUs. Launch cost, plan creation, autotuning, and workspace management are non-negligible for fine-grained contractions, especially if the plan contains many steps far below the critical-load scale. Modern GPU libraries explicitly address these effects with planning stages, plan caches, JIT compilation, and resource reuse mechanisms [8, 9]. Since such overheads are backendand version-dependent, we do not expose them as explicit library-specific features; instead, we retain structural surrogates that remain portable across software stacks. This design choice deserves emphasis. The goal is not to reproduce the private internal cost model of a specific library, but to define portable predictors of when library overhead is likely to matter. A high value of n_steps indicates a fragmented path that repeatedly re-enters the runtime system, while a high value of frac_tiny_steps suggests a long tail of steps whose useful numerical work may be small compared with their execution-management cost. These are precisely the kinds of effects that asymptotic complexity neglects but measured runtime reveals.
A.12 Final design principles and portability The final feature space is deliberately richer than a minimal cost summary. Several aggregated descriptors are correlated, but they encode distinct hypotheses about what actually limits runtime: a single catastrophic step, a broad near-critical tail, insufficient output parallelism in the dominant region, low reduction-driven reuse, unfavorable contraction geometry, or an accumulation of tiny-kernel overheads. Retaining this partial redundancy is preferable at the feature-design stage because it allows the downstream learning model, together with feature-importance analyses and ablations, to determine which structural mechanisms carry predictive signal on a given hardware/software stack. Importantly, the feature vector is derived entirely from the contraction plan and therefore does not change when the same plan is executed on a different GPU. What changes across backends is the measured runtime, and therefore the supervision signal used for learning and evaluation. Finally, although the present work targets binary tensor networks induced by qubit circuits, the construction extends directly to heterogeneous bond dimensions by replacing rank counts with base-2 logarithms of the corresponding dimension products. For example, pi becomes log2 |Oi |, while M , N , and K in Eq. (5) become the true grouped dimensions of the equivalent matrix multiplication. The feature design is therefore specific to the circuit-simulation setting, but not tied to binary tensors in any essential way.
27
Related documents
- Edge-Local and Qubit-Efficient Quantum Graph Learning for the NISQ Era#792704
- Edge-Local and Qubit-Efficient Quantum Graph Learning for the NISQ Era#788704
- Physics-Informed Neural Networks for Quantum Eigenvalue Problems#19800
- Scalable Quantum Machine Learning via Multi-layer Fully-Connected Variational Quantum Circuits#1129179
- MNISQ: A Large-Scale Quantum Circuit Dataset for Machine Learning in the NISQ Era.#255275
Retrieved via Conceptio: every document is proof-bundled with source, license, and retrieval metadata.
Read the Docs → · View CLI source on GitHub · Conceptio Open Knowledge Archive