Boulder Opal provides the functionality to optimize control pulses for dense arrays of semiconductor spin-qubits. The application of control techniques is challenging in these systems, because of two reasons. First, the highly non-linear relation between the control voltages and the exchange interaction is a challenge to gradient-based optimization algorithms and second, the control signals naturally also impose spurious effects on qubits neighboring the target qubit. For this reason the entire qubit array needs to be simulated and we cannot truncate the simulation to one or two qubits.
A recent example for a two-dimensional dense array is the implementation of four singlet-triplet qubits published by X. Zhang et al.. These densely placed singlet-triplet qubits naturally benefit from optimal control techniques, because their Hamiltonian includes an always-on term and driving single qubit rotations leads to spurious coupling with neighboring qubits. At the same time, the system size and non-linearity imposes a challenging control problem.
In this notebook, we will show how such a qubit array can be simulated and how we optimize quantum gates that are robust to charge noise. Thereby, we take into account:
Treatment of the non-linear relation between control voltages and the exchange interaction.
Strong noise dynamics caused by charge noise.
Rescaling control signals for efficient gradient-based optimization.
Pulse filtering to include bandwidth limits of the control electronics.
import numpy as np
import matplotlib.pyplot as plt
from pathlib import Path
from typing import Optional, Union
import copy
import jsonpickle
import time
import boulderopal as bo
import qctrlvisualizer as qv
plt.style.use(qv.get_qctrl_style())
# Read and write helper functions, type independent.
def save_variable(file_name: str, var):
"""
Save a single variable to a file using jsonpickle.
"""
with open(file_name, "w") as file:
encoded_var = jsonpickle.encode(var, unpicklable=True)
file.write(encoded_var)
def load_variable(file_name: str):
"""
Load a variable from a file encoded with jsonpickle.
"""
with open(file_name, "r") as file:
decoded_var = jsonpickle.decode(file.read())
return decoded_var
data_folder = Path("resources/")
timestr = time.strftime("%Y%m%d-%H%M%S")
print("Time label for data saved throughout this experiment:" + timestr)
save_files = False
load_files = True
time_label_loading = "20250123-104828"
Time label for data saved throughout this experiment:20250204-143958
We simulate a quantum processor architecture consisting of four singlet-triplet qubits that was demonstrated and described by X. Zhang et al. The qubits are formed in an 2×4 quantum dot array.
We label the quantum dots in the following way:
0 - 2 - 4 - 6
| | | |
1 - 3 - 5 - 7
Each vertical pair of quantum dots is tuned into a double quantum dot and is used to define a singlet-triplet qubit resulting in the qubit chain:
Q0 - Q1 - Q2 - Q3
Each adjacent pair of quantum dots and is separated by a barrier gate at voltage and the chemical potential of each quantum dot is controlled by a plunger gate at voltage . We define a detuning as the difference in plunger voltages for neighboring quantum dots,
and the average plunger voltage
We distinguish between intra-qubit detunings that detune two quantum dots forming one qubit e.g. and inter-qubit detuning that detune two quantum dots belonging to different qubits e.g. . We use the same terms for barrier voltages and exchange interactions.
We keep the average intra-qubit plunger voltages fixed at
and define the offsets of the plunger values such that each quantum dot is occupied by a single electron.
We can calculate the inter-qubit detuning of horizontal quantum dot pairs from the intra-qubit detuning of vertical quantum dot pairs. Consider four coupled quantum dots in a rectangle labeled i, j, k, and l:
i - k
| |
j - l
With the assumption that we have
and therefore
In total, this gives the system 14 degrees of freedom including the four intra-qubit detunings and all 10 barrier voltages. We assume that all gates are perfectly virtualized and neglect capacitive crosstalk. The model still includes crosstalk effects that occur due to the detuning inducing a coupling.
# Name generation
def detuning_name(
dot_1: int, dot_2: int, upscaled: bool = False, filtered: bool = False
):
prefix = "upscaled " if upscaled else ""
prefix += "filtered " if filtered else ""
return prefix + f"$e_{{{dot_1}{dot_2}}}$"
def barrier_name(
dot_1: int, dot_2: int, upscaled: bool = False, filtered: bool = False
):
prefix = "upscaled " if upscaled else ""
prefix += "filtered " if filtered else ""
return prefix + f"$b_{{{dot_1}{dot_2}}}$"
def exchange_name(dot_1: int, dot_2: int):
return f"$J_{{{dot_1}{dot_2}}}$"
def effective_exchange_name(qubit_1: int, qubit_2: int):
return f"$J_{{{qubit_1}{qubit_2}}}^e$"
def calculate_inter_qubit_detunings(voltage_signals: dict[str, bo.graph.Pwc]):
inter_qubit_detunings = []
for i in range(3):
# Upper side of the array
upper_inter_qubit_e = 0.5 * (
voltage_signals["intra_qubit_detuning"][i * 1]
- voltage_signals["intra_qubit_detuning"][i * 1 + 1]
)
upper_inter_qubit_e.name = detuning_name(i * 2, i * 2 + 2)
inter_qubit_detunings.append(upper_inter_qubit_e)
# Lower side of the array
lower_inter_qubit_e = -1 * upper_inter_qubit_e
lower_inter_qubit_e.name = detuning_name(i * 2 + 1, i * 2 + 3)
inter_qubit_detunings.append(lower_inter_qubit_e)
voltage_signals["inter_qubit_detuning"] = inter_qubit_detunings
return voltage_signals
The exchange interaction energy between two quantum dots depends approximately exponentially on the detuning and the barrier voltage. We chose to model the exchange interaction with the product ansatz
For the two qubit dynamics we also need to consider the inter-qubit exchange interaction that couples horizontal pairs of quantum dots. Consider again four coupled quantum dots in a rectangle labeled i, j, k and l:
i - k
| |
j - l
Then we can also calculate the exchange interaction in the vertical quantum dot pairs analogously to our treatment of the intra-qubit exchange. We define an effective interaction as average of the inter-qubit exchange interactions
def pulses_to_exchange_energies(
graph: bo.Graph, voltage_signals: dict[str, bo.graph.Pwc]
):
exchange_energies = dict()
# Intra-qubit exchange energies.
intra_qubit_exchange_energies = []
for i, intra_q_detuning, intra_q_barrier_v in zip(
range(len(voltage_signals["intra_qubit_detuning"])),
voltage_signals["intra_qubit_detuning"],
voltage_signals["intra_qubit_barrier_voltage"],
):
intra_q_exchange_energy = exchange_interaction(
j_0=default_j_0[i],
graph=graph,
detuning=intra_q_detuning,
barrier_voltages=intra_q_barrier_v,
)
intra_q_exchange_energy.name = exchange_name(i * 2, i * 2 + 1)
intra_qubit_exchange_energies.append(intra_q_exchange_energy)
exchange_energies["intra_qubit"] = intra_qubit_exchange_energies
# Inter-qubit exchange energies.
inter_q_exchange_energies = []
for i, inter_q_detuning, inter_q_barrier in zip(
range(len(voltage_signals["inter_qubit_detuning"])),
voltage_signals["inter_qubit_detuning"],
voltage_signals["inter_qubit_barrier_voltage"],
):
inter_q_exchange_energy = exchange_interaction(
j_0=default_j_0[0],
graph=graph,
detuning=inter_q_detuning,
barrier_voltages=inter_q_barrier,
)
inter_q_exchange_energy.name = exchange_name(i, i + 2)
inter_q_exchange_energies.append(inter_q_exchange_energy)
exchange_energies["inter_qubit"] = inter_q_exchange_energies
# The effective interaction is given by the average of the inter-qubit
# exchange energies as described above.
effective_inter_q_exchange = []
for i in range(3):
effective_exchange_energy = 0.5 * (
exchange_energies["inter_qubit"][i * 2]
+ exchange_energies["inter_qubit"][i * 2 + 1]
)
effective_exchange_energy.name = effective_exchange_name(i, i + 1)
effective_inter_q_exchange.append(effective_exchange_energy)
exchange_energies["effective_inter_qubit"] = effective_inter_q_exchange
return exchange_energies
This exponential relation between our control parameters and the energy term in the Hamiltonian is problematic for a gradient-based optimization, because derivatives of small voltage values are exponentially suppressed. We can remedy this issue with a rescaling. We optimize the barrier voltages on a logarithmic scale and we rescale the detuning with the inverse hyperbolic sine. This choice was made, because the hyperbolic sine closely resembles the exponential function of the absolute value, but the hyperbolic sine posesses the advantage of being invertible. We therefore optimize the upscaled voltages and .
At this point, you might ask why we are not directly optimizing the exchange interaction as it is common practice in many optimization frameworks. Our approach enables the treatment of noise on the voltage level, which makes our model much more accurate. We can take the influence of exponential relationship on the noise dynamics into account whereas other models inaccurately translate quasi-static charge noise into quasi-static noise on the exchange interaction.
def upscaling_barrier(barrier_voltages: np.ndarray) -> np.ndarray:
return np.exp(barrier_voltages / 10)
def downscaling_barrier(
graph: bo.Graph, barrier_voltages: bo.graph.Tensor, name=None
) -> bo.graph.Tensor:
downscaled_b = graph.log(barrier_voltages) * 10
if name:
downscaled_b.name = name
return downscaled_b
def upscaling_detuning(detuning_voltages: np.ndarray) -> np.ndarray:
return np.sinh(1.13 * detuning_voltages)
def downscaling_detuning(
graph: bo.Graph, detuning_voltages: bo.graph.Tensor, name=None
) -> bo.graph.Tensor:
downscaled_eps = (
graph.log(detuning_voltages + graph.sqrt(graph.pow(detuning_voltages, 2) + 1))
/ 1.13
)
if name:
downscaled_eps.name = name
return downscaled_eps
def downscale_voltages(graph: bo.Graph, voltage_signals: dict[str, bo.graph.Tensor]):
"""Applies the downscaling to all 14 optimizable control voltages."""
voltage_signals["intra_qubit_detuning"] = [
downscaling_detuning(
graph=graph,
detuning_voltages=signal,
name=detuning_name(i * 2, i * 2 + 1, upscaled=False),
)
for i, signal in enumerate(voltage_signals["intra_qubit_detuning"])
]
voltage_signals["intra_qubit_barrier_voltage"] = [
downscaling_barrier(
graph=graph,
barrier_voltages=signal,
name=barrier_name(i * 2, i * 2 + 1, upscaled=False),
)
for i, signal in enumerate(voltage_signals["intra_qubit_barrier_voltage"])
]
voltage_signals["inter_qubit_barrier_voltage"] = [
downscaling_barrier(
graph=graph,
barrier_voltages=signal,
name=barrier_name(i, i + 2, upscaled=False),
)
for i, signal in enumerate(voltage_signals["inter_qubit_barrier_voltage"])
]
We can verify the resemblence of the rescaling function and the ansatz for the exchange interaction.
In this example we focus on charge noise, because it is the most difficult noise source to include. We model the charge noise as quasi-static shifts of the control voltages and all shifts are assumed to vary in their origin and therefore to be uncorrelated. This approach is straight forward and also includes higher-order noise dynamics which can be exponentially amplified in the functional form of the exchange interaction.
Boulder Opal also supports a variety of other noise models. You can find guidance on how to add colored noise or simulate the experiment as an open system in the linked notebooks to include markovian noise.
# Seed the noise trace generation for reproducibility.
noise_seed = 0
# Standard deviation of charge fluctuations on control lines.
std_charge_noise = 0.001 # mV
def add_charge_noise_to_signals(
graph: bo.Graph,
noise_sample_count: int,
sigma: float,
voltage_signals: dict[str, bo.graph.Pwc],
):
# We assume that the noise on every physical gate is equal.
# The standard deviation of the detuning is stronger, because it
# results from the noise on two plunger gates.
standard_deviations = {
"intra_qubit_detuning": np.sqrt(2) * sigma,
"intra_qubit_barrier_voltage": sigma,
"inter_qubit_barrier_voltage": sigma,
}
noisy_signals = {}
seed_counter = 0
for gate_type in voltage_signals:
noisy_voltage_signals = []
for voltage_signal in voltage_signals[gate_type]:
noise_signal = graph.constant_pwc(
graph.random.normal(
shape=[noise_sample_count, 1],
mean=0,
standard_deviation=standard_deviations[gate_type],
seed=noise_seed + seed_counter,
),
duration=sum(voltage_signal.durations),
batch_dimension_count=1,
)
seed_counter += 1
noisy_voltage_signals.append(noise_signal + voltage_signal)
noisy_signals[gate_type] = noisy_voltage_signals
return noisy_signals
The considered singlet-triplet qubit is encoded in the singlet state and in the lowest-energy triplet state . Leakage into the excited triplet states and is neglected.
The Hamiltonian can be formulated with the Pauli operators and a coupling operator that describes the effective 2-qubit interaction.
The coupling operator natively generates a SWAP-like 2-qubit gate that is equivalent to SWAP + iSWAP, but we will show that we can use optimal control techniques to create non-native 2-qubit gates like the CNOT gate.
# coupling operators
coupling_matrix = np.asarray(
[[-1, 0, 0, 0], [0, -1, 1, 0], [0, 1, -1, 0], [0, 0, 0, 0]]
)
def pauli_and_coupling_operators(graph, qubit_count):
"""Create Pauli and coupling operators for n qubits."""
if qubit_count == 1:
embedded_coupling_matrices = []
elif qubit_count == 2:
embedded_coupling_matrices = [coupling_matrix]
else:
embedded_coupling_matrices = []
for i in range(qubit_count - 1):
index_list = [2] * (qubit_count - 2)
index_list.insert(i, 4)
embedded_coupling_matrices.append(
graph.embed_operators(
operators=[coupling_matrix, i], dimensions=index_list
)
)
pauli_z_operators = [
graph.embed_operators(
operators=[graph.pauli_matrix("Z"), i], dimensions=[2] * qubit_count
)
for i in range(qubit_count)
]
pauli_x_operators = [
graph.embed_operators(
operators=[graph.pauli_matrix("X"), i], dimensions=[2] * qubit_count
)
for i in range(qubit_count)
]
return pauli_x_operators, pauli_z_operators, embedded_coupling_matrices
The Hamiltonian of the system consists of a sum of Hamiltonians describing the dynamics of the singlet-triplet qubits
and coupling Hamiltonians for each pair of adjacent qubits
Our model is an effective model by construction that neglects orbital degrees of freedom and only describes effective spin dynamics. These effective models are derived from single and two-qubit experiments and we need to make further assumptions so that they remain valid in the multi-qubit array. The most important assumption is that for each quantum dot, only a single exchange is driven at a time. In a physical picture, this means that the wave function of each hole stretches only over a single quantum dot or a double quantum dot. We do not form strongly coupled triple quantum dots.
We enforce this assumption and thereby yield physical simulations, by penalizing control pulses that drive two exchange interactions of one dot at the same time. We have adjusted the scaling of the penalty in the overall cost function to balance high fidelity with low overlap simultaneous driving signals on overlapping quantum dot pairs.
def simultaneous_driving_penalty(graph: bo.Graph, exchange_energies):
penalty = 0
for i in range(3):
# product between intra and upper inter
penalty += graph.sum(
exchange_energies["intra_qubit"][i].values
* exchange_energies["inter_qubit"][2 * i].values
)
penalty += graph.sum(
exchange_energies["intra_qubit"][i + 1].values
* exchange_energies["inter_qubit"][2 * i].values
)
# product between intra and lower inter
penalty += graph.sum(
exchange_energies["intra_qubit"][i].values
* exchange_energies["inter_qubit"][2 * i + 1].values
)
penalty += graph.sum(
exchange_energies["intra_qubit"][i + 1].values
* exchange_energies["inter_qubit"][2 * i + 1].values
)
penalty.name = "simultaneous_exchange_penalty"
return penalty
In order to create realistic control pulses generated by control electronics with a finite bandwidth, we apply a pulse filtering with a gaussian kernel.
def smooth_voltages(graph: bo.Graph, voltage_signals: dict, segment_count: int):
kernel = graph.gaussian_convolution_kernel(std=1)
voltage_signals["intra_qubit_detuning"] = [
graph.filter_and_resample_pwc(
pwc=signal,
kernel=kernel,
segment_count=segment_count,
name=detuning_name(i * 2, i * 2 + 1, upscaled=False, filtered=True),
)
for i, signal in enumerate(voltage_signals["intra_qubit_detuning"])
]
voltage_signals["intra_qubit_barrier_voltage"] = [
graph.filter_and_resample_pwc(
pwc=signal,
kernel=kernel,
segment_count=segment_count,
name=barrier_name(i * 2, i * 2 + 1, upscaled=False, filtered=True),
)
for i, signal in enumerate(voltage_signals["intra_qubit_barrier_voltage"])
]
voltage_signals["inter_qubit_barrier_voltage"] = [
graph.filter_and_resample_pwc(
pwc=signal,
kernel=kernel,
segment_count=segment_count,
name=barrier_name(i, i + 2, upscaled=False, filtered=True),
)
for i, signal in enumerate(voltage_signals["inter_qubit_barrier_voltage"])
]
To save all control pulses and exchange interactions, we build a full list of names of useful pulse related quantities.
## detuning names
pulse_related_names = []
# filtered pulses
pulse_related_names += [
detuning_name(i * 2, i * 2 + 1, filtered=True) for i in range(4)
]
pulse_related_names += [barrier_name(i * 2, i * 2 + 1, filtered=True) for i in range(4)]
pulse_related_names += [barrier_name(i, i + 2, filtered=True) for i in range(6)]
## intra_qubit exchange names
pulse_related_names += [exchange_name(i * 2, i * 2 + 1) for i in range(4)]
# effective_exchange
pulse_related_names += [effective_exchange_name(i, i + 1) for i in range(3)]
We demonstrate the optimization of a CNOT gate, which is not native to the exchange interaction (unlike SWAP-style gates). We show how Boulder Opal can be employed to find control pulses that realize this gate with robustness to charge noise.
For a comparison, we start with the optimization of a control pulse in the absence of charge noise as is standard in most optimal control software packages.
The plot above shows that the robust pulse leads to a strongly suppressed charge noise susceptibility over realistic charge noise ranges, which usually is in the order of a few µV, see for example Dial et al. or Nakajima et al..
We can now compare the pulses that were found by the robust and the standard optimization. We start by having a look at the exchange energies in the standard pulse.
def plot_pwc(
result: dict,
name_list: list[str],
title: Optional[str] = None,
noise_index: Optional[int] = None,
two_pi_factor: bool = True,
si_unit_quotient: float = 1e9,
time_unit_quotient: float = 1e-9,
unit_symbol: str = "Hz",
):
controls = {}
for name in name_list:
controls[name] = copy.deepcopy(result["output"][name])
if noise_index is None:
controls[name]["values"] = np.squeeze(
si_unit_quotient * controls[name]["values"]
)
else:
controls[name]["values"] = np.squeeze(
si_unit_quotient * controls[name]["values"][noise_index, ...]
)
controls[name]["durations"] = time_unit_quotient * controls[name]["durations"]
qv.plot_controls(
controls=controls,
two_pi_factor=two_pi_factor,
unit_symbol=unit_symbol,
smooth=True,
)
if title is not None:
plt.gcf().get_axes()[0].set_title(title)
plot_pwc(
result=result_cnot_coherent,
name_list=[exchange_name(i * 2, i * 2 + 1) for i in range(4)],
title="Standard pulse: intra-qubit exchange energies",
)
plot_pwc(
result=result_cnot_coherent,
name_list=[effective_exchange_name(i, i + 1) for i in range(3)],
title="Standard pulse: effective inter-qubit exchange energies",
)
We observe that the intra-qubit exchange interactions on all qubits reach values in the Ghz range. The effective inter-qubit exchange is strong between qubits 0 and 1, where we implement the CNOT gate and small otherwise. (Please note the different units on the Y-axis.)
Next, we look at the exchange values of the robust pulse.
plot_pwc(
result=result_cnot_robust,
name_list=[exchange_name(i * 2, i * 2 + 1) for i in range(4)],
noise_index=0,
title="Robust pulse: intra-qubit exchange energies",
)
plot_pwc(
result=result_cnot_robust,
name_list=[effective_exchange_name(i, i + 1) for i in range(3)],
noise_index=0,
title="Robust pulse: effective inter-qubit exchange energies",
)
The exchange values are much slower with peak values below 100 MHz. We can observe that a central reason for the noise resilience is the use of lower exchange energies, because the exponential relation between the control pulses and the exchange interaction amplifies noise at higher values. This feature cannot be captured, when a quasi-static noise term is added to the exchange interaction.
We also plot the filtered control pulses for the robust pulse to analyse which gates are primarily used to drive the CNOT gate.
plot_pwc(
result=result_cnot_robust,
name_list=[detuning_name(i * 2, i * 2 + 1, filtered=True) for i in range(4)],
two_pi_factor=False,
si_unit_quotient=1e-3,
unit_symbol="V",
title="Robust pulse: intra-qubit detuning pulses",
)
plot_pwc(
result=result_cnot_robust,
name_list=[barrier_name(i * 2, i * 2 + 1, filtered=True) for i in range(4)],
two_pi_factor=False,
si_unit_quotient=1e-3,
unit_symbol="V",
title="Robust pulse: intra-qubit barrier pulses",
)
plot_pwc(
result=result_cnot_robust,
name_list=[barrier_name(i, i + 2, filtered=True) for i in range(6)],
two_pi_factor=False,
si_unit_quotient=1e-3,
unit_symbol="V",
title="Robust pulse: inter-qubit barrier pulses",
)
Here, we observe that all control signals are sufficiently smooth. We also note that the interaction is driven more strongly by the barrier voltages. Thereby, our model reproduces the experimental observation that symmetric exchange gates have a smaller susceptibility to charge noise.
Was this useful?
New to Boulder Opal?
Get access to everything you need to automate and optimize quantum hardware performance at scale.