---
title: Variable-Depth NSGA-II Algorithm
url: https://www.emergentmind.com/topics/variable-depth-nsga-ii-algorithm
type: topic
---

# Variable-Depth NSGA-II Algorithm

The variable-depth NSGA-II algorithm is an enhanced evolutionary search method tailored to multiobjective quantum architecture search (QAS), where candidate parameterized quantum circuits (ansätze) are automatically synthesized under noisy hardware constraints. This approach extends the classical NSGA-II (Non-dominated Sorting Genetic Algorithm II) to operate efficiently over circuit populations of variable depth, optimizing simultaneously for noise-robust expressibility and quantum hardware cost. Integration of a hybrid Hamiltonian ε-greedy parameter-sharing mechanism further accelerates convergence and maintains gradient diversity. The methodology has been validated for quantum binary and multi-class classification under realistic noise, yielding resource-efficient, high-performing quantum architectures [2601.10965].

## 1. Variable-Depth Encoding of Quantum Circuits

Each individual in the population represents a candidate quantum circuit encoded as an ordered vector of $l$ quantum “layers,” where $l$ ranges within $[l_{\min},\,l_{\max}]$ and can mutate during evolution. Each layer is selected from the layer search space
\[
\mathcal S_{\rm layer} = R_{\rm space} \times \mathrm{CNOT}_{\rm space},
\]
with $R_{\rm space} = \{R_x, R_y, R_z\}^n$ for all combinations of single-qubit Pauli rotations on $n$ qubits, and $\mathrm{CNOT}_{\rm space}$ consisting of all $2^{n(n-1)/2}$ possible CNOT gate subsets. An individual is encoded as
\[
A = (g_1,\,g_2,\,\dots,\,g_l), \quad g_i\in\{0, \dots, |\mathcal S_{\rm layer}|-1\}, \quad l\in[l_{\min},l_{\max}]
\]
allowing for efficient insertions and deletions of circuit layers. This flexible integer-vector encoding facilitates the evolution of architectures with dynamically varying depths, directly reflecting quantum resource tradeoffs.

## 2. Multiobjective Formulation

The QAS problem is formalized as a two-objective minimization over the expressive power of the quantum ansatz under noise and the associated hardware cost. The fitness vector reads:
\[
F(A) = (\mathcal E(A),\, \mathcal C(A))
\]
where
- **Expressibility / task performance under noise:**
  \[
  \mathcal E(A) = \min_{\theta} \langle \psi(\theta,A)|\hat H_{\rm task}|\psi(\theta,A)\rangle
  \]
  is the expectation value under a noise model, with task Hamiltonian $\hat H_{\rm task}$.
- **Hardware cost:**
  \[
  \mathcal C(A) = \alpha\,N_{\rm CNOT}(A) + \beta\,N_{\rm depth}(A)
  \]
  aggregates the number of CNOT gates and circuit depth, weighted by tunable coefficients $\alpha,\beta$.

Both objectives are minimized, ensuring that the discovered circuits are both high-performing and resource-efficient in noisy quantum environments.

## 3. Algorithmic Framework

The enhanced variable-depth NSGA-II follows the broad structure of classical NSGA-II but introduces several key modifications for quantum circuit search and noise-awareness:

```plaintext
Function NA-QAS(N_pop, G_max, [l_min,l_max], θ_shared, H_task, 𝒩)
 1. Initialize P₀ by sampling l∈[l_min,l_max] and drawing g_j from 𝓢_layer
 2. Set global Pareto front PF ← ∅
 3. For t = 0 to G_max-1:
    a) Fine-tune circuit weights for each A ∈ P_t (hybrid Hamiltonian, noise-in-the-loop)
    b) Evaluate fitness F(A) = (𝓔, 𝓒)
    c) Non-dominated sort, assign crowding distances
    d) Generate offspring through:
        - Tournament selection
        - Simulated binary crossover (SBX) on integer vectors
        - Polynomial mutation
        - Quantum mutations: insert/delete/replace layer
    e) Form R_t = P_t ∪ Q_t, elitist selection, update PF
 4. Return PF
```

Fitness evaluations employ fine-tuning of shared parameters under noise, with the hybrid Hamiltonian strategy ensuring robust adaptation. Variation operators act natively on variable-length encodings, and elitist, crowding-aware selection preserves global diversity along the Pareto front.

## 4. Genetic Operators for Variable-Length Individuals

Distinct genetic operators are defined to support variable-depth circuit evolution:

- **Initialization:** Each individual is assigned a random depth $l\in[l_{\min}, l_{\max}]$, and each layer $g_j$ is uniformly sampled from $\mathcal S_{\rm layer}$.
- **Selection:** Tournament selection is performed using standard NSGA-II rank and crowding distance metrics, fully compatible with variable-length individuals.
- **Crossover (SBX):** Parents $A = (g_1, \dots, g_{l_A})$, $B = (h_1, \dots, h_{l_B})$ are aligned up to $\min(l_A, l_B)$; excess genes are stochastically copied or discarded, constraining offspring depth within bounds.
- **Mutation:**
  - **Polynomial mutation:** Each gene undergoes perturbation as per the polynomial mutation distribution.
  - **Depth-specific mutations:**
    1. **InsertLayer:** Insert a fresh layer at a random position, $l\mapsto l+1$ (if $l<l_{\max}$).
    2. **DeleteLayer:** Randomly remove a layer, $l\mapsto l-1$ (if $l>l_{\min}$).
    3. **ReplaceLayer:** Replace an existing layer with a randomly sampled new one.

Variable-depth mutation induces exploration across architectures with distinct hardware footprints and functional expressibilities.

## 5. Hybrid Hamiltonian ε-Greedy Parameter-Sharing

Fine-tuning of circuit parameters leverages an ε-greedy strategy to mitigate the risk of parameter collapse (barren plateau) and reduce redundant retraining. All individuals share a global parameter set $\theta_{\rm shared}$, together with small “supernet” classical heads $E_k(x) = W_k x + b_k$, $k=1,\dots,K$. During fine-tuning:

1. For ansatz $A$, evaluate $\langle\psi(\theta, A)|\hat H_k|\psi(\theta,A)\rangle$ for all $k$; denote the best index $k^* = \arg\min_k$.
2. With probability $1-\varepsilon$, update using the best Hamiltonian $\hat H_{k^*}$; with probability $\varepsilon$, update using a uniform mixture $\hat H_{\rm unif}$:
   \[
   \hat H_{\rm mix} = (1-\varepsilon)\hat H_{k^*} + \varepsilon \hat H_{\rm unif}
   \]
3. Parameters are updated by gradient descent on
   \[
   \langle\psi(\theta,A)|\hat H_{\rm mix}|\psi(\theta,A)\rangle
   \]
4. Only the selected supernet head $(W_{k}, b_{k})$ is updated.

This approach fosters exploration while concentrating exploitation on the most promising task Hamiltonian, leading to improved robustness and training efficiency under noise.

## 6. Computational Complexity and Convergence

The dominant computational cost per generation arises from fine-tuning parameters for all $N_{\rm pop}$ individuals over $T$ gradient steps, each involving quantum circuit simulation under noise of cost $C_q$, for a total $O(N_{\rm pop}\, T\, C_q)$. Non-dominated sorting scales as $O(N_{\rm pop}^2)$. Allowing variable depth expands the search cardinality from $|\mathcal S_{\rm layer}|^l$ (fixed $l$) to
\[
\sum_{l=l_{\min}}^{l_{\max}} |\mathcal S_{\rm layer}|^l
\]
while the specialized genetic operators maintain tractability and population diversity. The ε-greedy hybrid Hamiltonian stabilizes parameter trajectories, improving the convergence of ansatz fine-tuning. NSGA-II elitism and crowding distance further guarantee monotonic improvement and spread of the Pareto front. Reported convergence is typically achieved in $G_{\max}=50$–$200$ generations on standard variational quantum algorithm (VQA) benchmarks, with wall-clock time reduced by an order of magnitude relative to naïve retraining [2601.10965].

Source: https://www.emergentmind.com/topics/variable-depth-nsga-ii-algorithm