Comprehensive quantum technology experiment
Cutting-edge technology of quantum information
Sample calibration (Lab plate operation)
Sample calibration process
The comprehensive quantum technology experimental module is unique and requires accurate calibration for different samples to ensure the accuracy of experimental results. The calibration process is as follows:
Sample selection: In the experimental settings interface, select a specific sample-water sample (H₂O) -dimethyl phosphite sample (CH₃PO(CH₂CH₃)₂)
Calibration operation: -Click the “Calibration” button-select “Start Calibration” -patiently wait for the calibration process to complete-the system prompts that the calibration is complete
Remote experiment: After the calibration is completed, remote quantum experiments can be carried out
Note: If the sample calibration is not performed, an error message “Calibration not performed” will appear during the experiment, preventing it from proceeding normally.
spin echo
Pulse counting to extend spin quantum coherence time
from spinqlablink import SpinQLabLink, ExperimentType, Pulse
from spinqlablink import print_graph
def main():
# Create connection
spinqlablink = SpinQLabLink("192.168.15.4", 8181, "anyword", "anyword")
spinqlablink.connect()
if not spinqlablink.wait_for_login():
print("Login failed")
return
# Register Spin Echo experiment
# Spin Echo is a technique to reverse the dephasing of spins caused by inhomogeneities
# in the magnetic field, allowing measurement of the true T2 relaxation time
_, exp_spinecho_para = spinqlablink.register_experiment(ExperimentType.SPIN_ECHO)
# Define the pulse sequence for the spin echo experiment
# Typically consists of a π/2 pulse followed by a π pulse after a delay
# The π/2 pulse rotates the magnetization into the transverse plane
# The π pulse inverts the spins, causing them to refocus and form an echo
exp_spinecho_para.pulses = [Pulse(path=0,width=40, amplitude=100, phase=90, detuning=0)]
# Set experiment parameters
# Sampling parameters
exp_spinecho_para.sampleCount = 16000 # Number of data points to collect
exp_spinecho_para.sampleFre = 10000 # Sampling frequency in Hz
exp_spinecho_para.sampleDelay = 40 # Delay before sampling starts (in microseconds)
# This delay is important to capture the echo signal
# Frequency parameters
exp_spinecho_para.h_freShift = 0 # Hydrogen frequency shift in Hz
exp_spinecho_para.h_freDemo = 0 # Hydrogen frequency demodulation in Hz
# Channel selection
exp_spinecho_para.samplePath = 0 # Sampling path: 0=Hydrogen channel
# Run the experiment
spinqlablink.run_experiment()
print("Waiting for experiment completion")
spinqlablink.wait_for_experiment_completion()
# Get the results
exp_info = spinqlablink.get_experiment_result()
spinqlablink.disconnect()
# Display the results
# The spin echo signal should show a characteristic peak (the "echo")
# after the refocusing pulse
if "result" in exp_info:
exp_result = exp_info["result"]
for key, value in exp_result.items():
if key != "graph":
print(f"{key}: {value}")
print_graph(exp_info["result"])
else:
print("Experiment failed")
if __name__ == "__main__":
main()
Analysis of experimental parameters
sample_type: Sample type, default water (H₂O)
ExperimentType: Experiment type, select SPIN_ECHO, and set the experiment type (see
spinqlablink.ExperimentTypefor details)Pulse: Define the pulse sequence and set the path, width, amplitude, phase and frequency offset of the pulse (see
spinqlablink.Pulsefor details)samplePath: Sampling path, 0= hydrogen channel, 1= phosphorus channel [0-1]
sampleCount: sampling points [4000-16000]
sampleFre: Sampling frequency [10000-100000]
sampleDelay: sampling delay (us) [0- 2000000]
h_freShift: Hydrogen frequency offset (hz) [0-10000]
h_freDemo: Hydrogen frequency demodulation (hz) [0-10000]
Analysis of experimental results
{
"result":{
"graph":[
{ # step 0
"fidRe": [[x,y],...],
"fidIm":[[x,y],...],
"fftRe":[[x,y],...],
"fftIm":[[x,y],...],
"lorenz":[[x,y],...],
"fftRe":[[x,y],...],
"fftIm":[[x,y],...],
"fftMod":[[x,y],...],
"fidMod":[[x,y],...],
"fftFit":[[x,y],...]
},
{ # step 1},
...
]
"coordinate":{
"x":0,
"y":0
},
"phase":0
}
}
graph: Chart data, including real and imaginary parts, and the graph contains 1 step
coordinate: spin phase coordinates
phase: phase, angle system
dynamic decoupling
Techniques for decoupling spin dynamics
from spinqlablink import SpinQLabLink, ExperimentType, Pulse
from spinqlablink import print_graph
def main():
# Create connection
spinqlablink = SpinQLabLink("192.168.15.4", 8181, "anyword", "anyword")
spinqlablink.connect()
if not spinqlablink.wait_for_login():
print("Login failed")
return
# Register Dynamic Decoupling experiment
# Dynamic Decoupling is a technique to suppress decoherence in quantum systems
# by applying a sequence of control pulses that effectively "undo" the
# environmental noise effects, extending coherence times
_, exp_dydeco_para = spinqlablink.register_experiment(ExperimentType.DYNAMIC_DECOUPLING)
# Define the pulse sequence for the dynamic decoupling
# This is typically a series of π pulses that periodically flip the qubits
# Common sequences include CPMG (Carr-Purcell-Meiboom-Gill) and XY4/XY8
exp_dydeco_para.pulses = [Pulse(path=0,width=40, amplitude=100, phase=90, detuning=0)]
# Set experiment parameters
# Sampling parameters
exp_dydeco_para.sampleCount = 16000 # Number of data points to collect
exp_dydeco_para.sampleFre = 10000 # Sampling frequency in Hz
exp_dydeco_para.sampleDelay = 0 # Delay before sampling starts (in microseconds)
# Frequency parameters
exp_dydeco_para.h_freShift = 0 # Hydrogen frequency shift in Hz
exp_dydeco_para.p_freShift = 0 # Phosphorus frequency shift in Hz
exp_dydeco_para.h_freDemo = 0 # Hydrogen frequency demodulation in Hz
exp_dydeco_para.p_freDemo = 0 # Phosphorus frequency demodulation in Hz
# Channel selection
exp_dydeco_para.samplePath = 0 # Sampling path: 0=Hydrogen channel, 1=Phosphorus channel
# Run the experiment
spinqlablink.run_experiment()
print("Waiting for experiment completion")
spinqlablink.wait_for_experiment_completion()
# Get the results
exp_info = spinqlablink.get_experiment_result()
spinqlablink.disconnect()
# Display the results
# The results should show improved coherence compared to standard T2 measurements
if "result" in exp_info:
exp_result = exp_info["result"]
for key, value in exp_result.items():
if key != "graph":
print(f"{key}: {value}")
print_graph(exp_info["result"])
else:
print("Experiment failed")
if __name__ == "__main__":
main()
Analysis of experimental parameters
sample_type: Sample type, default dimethyl phosphite (CH₃PO(CH₂CH₃)₂)
ExperimentType: Experiment type, select DYNAMIC_DECOUPLING, and set the experiment type (see
spinqlablink.ExperimentTypeclass for details)Pulse: Define the pulse sequence and set the path, width, amplitude, phase and frequency offset of the pulse (see
spinqlablink.Pulsefor details)samplePath: Sampling path, 0= hydrogen channel, 1= phosphorus channel [0-1]
sampleCount: sampling points [4000-16000]
sampleFre: Sampling frequency [10000-100000]
sampleDelay: sampling delay (us) [0- 2000000]
h_freShift: Hydrogen frequency offset (hz) [0-10000]
p_freShift: Phosphorus frequency offset (hz) [0-10000]
h_freDemo: Hydrogen frequency demodulation (hz) [0-10000]
p_freDemo: Phosphorus frequency demodulation (hz) [0-10000]
Analysis of experimental results
{
"result":{
"graph":[
{ # step 0
"fidRe": [[x,y],...],
"fidIm":[[x,y],...],
"fftRe":[[x,y],...],
"fftIm":[[x,y],...],
"lorenz":[[x,y],...],
"fftRe":[[x,y],...],
"fftIm":[[x,y],...],
"fftMod":[[x,y],...],
"fidMod":[[x,y],...],
"fftFit":[[x,y],...]
},
{ # step 1},
...
]
"up_state_coupling":{
"x":0,
"y":0
},
"no_coupling":{
"x":0,
"y":0
},
"down_state_coupling":{
"x":0,
"y":0
}
}
}
graph: Chart data, including real and imaginary parts, and the graph contains 1 step
up_state_coupling: upper state coupling
no_coupling: no coupling
down_state_coupling: down-state coupling
shape pulses
Pulse technique for modulating RF field envelope
from spinqlablink import SpinQLabLink, ExperimentType
from spinqlablink import print_graph, WaveformGenerator, pulse_domain_analysis
def main():
# Create connection
spinqlablink = SpinQLabLink("192.168.15.4", 8181, "anyword", "anyword")
spinqlablink.connect()
if not spinqlablink.wait_for_login():
print("Login failed")
return
# Register Shape Pulse experiment
_, exp_shape_pulse_para = spinqlablink.register_experiment(ExperimentType.SHAPE_PULSE)
# Generate a shaped pulse using the WaveformGenerator
# Parameters:
# - channel: 0 for hydrogen channel, 1 for phosphorus channel
# - wave_type: Type of waveform (GAUSSIAN, SQUARE, SINC, etc.)
# - samplePoint: Number of discrete points in the waveform
# - timeLength: Total duration of the pulse in nanoseconds
# - phase: Phase of the pulse in degrees
# - amplitude: Amplitude of the pulse (percentage, 0-100)
# - detuning: Frequency detuning in Hz
pulses = WaveformGenerator.generate(channel=0,
wave_type=WaveformGenerator.GAUSSIAN,
samplePoint=64,
timeLength=10000,
phase=0, amplitude=100, detuning=0)
exp_shape_pulse_para.pulses = pulses
pulse_domain_analysis(pulses)
# Set experiment parameters
exp_shape_pulse_para.calibrate_sample = 0 # Sample type: 0 for dimethyl phosphite (CH₃PO(CH₂CH₃)₂), 1 for water (H₂O)
# Sampling parameters
exp_shape_pulse_para.sampleCount = 16000 # Number of data points to sample
exp_shape_pulse_para.sampleFre = 10000 # Sampling frequency in Hz
exp_shape_pulse_para.sampleDelay = 0 # Delay before sampling starts (in microseconds)
# Frequency parameters
exp_shape_pulse_para.h_freShift = 0 # Hydrogen frequency shift in Hz
exp_shape_pulse_para.p_freShift = 0 # Phosphorus frequency shift in Hz
exp_shape_pulse_para.h_freDemo = 0 # Hydrogen frequency demodulation in Hz
exp_shape_pulse_para.p_freDemo = 0 # Phosphorus frequency demodulation in Hz
# Channel selection: 0=Hydrogen, Only channel 0 is supported, which corresponds to Hydrogen
exp_shape_pulse_para.samplePath = 0
# Run the experiment
spinqlablink.run_experiment()
print("Waiting for experiment completion")
spinqlablink.wait_for_experiment_completion()
# Get the results
exp_info = spinqlablink.get_experiment_result()
spinqlablink.disconnect()
# Display the results
if "result" in exp_info:
exp_result = exp_info["result"]
for key, value in exp_result.items():
if key != "graph":
print(f"{key}: {value}")
print_graph(exp_info["result"])
else:
print("Experiment failed")
if __name__ == "__main__":
main()
Analysis of experimental parameters
WaveformGenerator.generate(): Generate a pulse sequence, see
spinqlablink.WaveformGeneratorclass for detailssample_type: Sample type, 0= dimethyl phosphite (CH₃PO(CH₂CH₃)₂), 1= Water (H₂O)
ExperimentType: Experiment type, select SHAPE_PULSE, and set the experiment type (see
spinqlablink.ExperimentTypeclass for details)Pulse: Define the pulse sequence and set the path, width, amplitude, phase and frequency offset of the pulse (see
spinqlablink.Pulsefor details)samplePath: Sampling path, 0= hydrogen channel, 1= phosphorus channel [0,1]
sampleCount: sampling points [4000-16000]
sampleFre: Sampling frequency [10000-100000]
sampleDelay: sampling delay (us) [0- 2000000]
h_freShift: Hydrogen frequency offset (hz) [0-10000]
p_freShift: Phosphorus frequency offset (hz) [0-10000]
h_freDemo: Hydrogen frequency demodulation (hz) [0-10000]
p_freDemo: Phosphorus frequency demodulation (hz) [0-10000]
Analysis of experimental results
{
"result":{
"graph":[
{ # step 0
"fidRe": [[x,y],...],
"fidIm":[[x,y],...],
"fftRe":[[x,y],...],
"fftIm":[[x,y],...],
"lorenz":[[x,y],...],
"fftRe":[[x,y],...],
"fftIm":[[x,y],...],
"fftMod":[[x,y],...],
"fidMod":[[x,y],...],
"fftFit":[[x,y],...]
},
{ # step 1},
...
]
"coordinate":{
"x":0,
"y":0,
"z":1
},
"matrix": { # The density matrix of a quantum state, including its real and imaginary parts
"real": [[0.25, 0.25, 0.25, 0.25], [0.25, 0.25, 0.25, 0.25], [0.25, 0.25, 0.25, 0.25], [0.25, 0.25, 0.25, 0.25]],
"imag": [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]
},
"probability": [0.25, 0.25, 0.25, 0.25], # Probability distribution of measurement results
}
}
graph: Chart data, including real and imaginary parts, and the graph contains 2 steps
coordinate: single-bit Bloch spherical coordinates
- matrix: The density matrix of the quantum state, including the real and imaginary parts
real: real
imag: imaginary part
probability: probability distribution of measurement results
numerical pulse optimization
Pulse technology based on optimization algorithm
from spinqlablink import SpinQLabLink, ExperimentType
from spinqlablink import print_graph, WaveformGenerator, pulse_domain_analysis
def main():
# Create connection
spinqlablink = SpinQLabLink("192.168.15.4", 8181, "anyword", "anyword")
spinqlablink.connect()
if not spinqlablink.wait_for_login():
print("Login failed")
return
# Register Numerical Optimization Pulse experiment
# This experiment uses numerical optimization techniques to find optimal pulse shapes
# for quantum control operations, improving gate fidelity and reducing errors
_, exp_nopti_para = spinqlablink.register_experiment(ExperimentType.NUMERICAL_OPTIMIZATION_PULSE)
# Generate a Gaussian pulse shape using the WaveformGenerator
# Parameters:
# - channel: 0 for hydrogen channel
# - wave_type: GAUSSIAN creates a bell-shaped pulse with smooth transitions
# - samplePoint: 64 discrete points for the waveform
# - timeLength: 10000 microseconds total duration
# - phase: 0 degrees phase angle
# - amplitude: 100% of maximum amplitude
# - detuning: 0 Hz frequency offset
pulses = WaveformGenerator.generate(channel=0,
wave_type=WaveformGenerator.GAUSSIAN,
samplePoint=64,
timeLength=10000,
phase=0, amplitude=100, detuning=0)
exp_nopti_para.pulses = pulses
pulse_domain_analysis(pulses)
# Set experiment parameters
# Sample calibration
exp_nopti_para.calibrate_sample = 0 # 0 for CH₃PO(CH₂CH₃)₂, 1 for H₂O
# Different samples require different calibration settings
# Sampling parameters
exp_nopti_para.sampleCount = 16000 # Number of data points to collect
exp_nopti_para.sampleFre = 10000 # Sampling frequency in Hz
exp_nopti_para.sampleDelay = 0 # Delay before sampling starts (in microseconds)
# Frequency parameters
exp_nopti_para.h_freShift = 0 # Hydrogen frequency shift in Hz
exp_nopti_para.p_freShift = 0 # Phosphorus frequency shift in Hz
exp_nopti_para.h_freDemo = 0 # Hydrogen frequency demodulation in Hz
exp_nopti_para.p_freDemo = 0 # Phosphorus frequency demodulation in Hz
# Channel selection
exp_nopti_para.samplePath = -1 # Sampling path: 0=Hydrogen channel, 1=Phosphorus channel, -1=both channels
# Using both channels allows comparing the effects on different nuclei
# Run the experiment
spinqlablink.run_experiment()
print("Waiting for experiment completion")
spinqlablink.wait_for_experiment_completion()
# Get the results
exp_info = spinqlablink.get_experiment_result()
spinqlablink.disconnect()
# Display the results
# The results should show the system response to the optimized pulse shape
if "result" in exp_info:
exp_result = exp_info["result"]
for key, value in exp_result.items():
if key != "graph":
print(f"{key}: {value}")
print_graph(exp_info["result"])
else:
print("Experiment failed")
if __name__ == "__main__":
main()
Analysis of experimental parameters
WaveformGenerator.generate(): Generate a pulse sequence, see
spinqlablink.WaveformGeneratorclass for detailssample_type: Sample type, 0= dimethyl phosphite (CH₃PO(CH₂CH₃)₂), 1= Water (H₂O)
ExperimentType: Experiment type, select NUMERICAL_OPTIMIZATION_PULSE, and set the experiment type (see
spinqlablink.ExperimentTypeclass for details)Pulse: Define the pulse sequence and set the path, width, amplitude, phase and frequency offset of the pulse (see
spinqlablink.Pulsefor details)samplePath: Sampling path,-1= all channels, 0= hydrogen channel, 1= phosphorus channel [-1,0,1]
sampleCount: sampling points [4000-16000]
sampleFre: Sampling frequency [10000-100000]
sampleDelay: sampling delay (us) [0- 2000000]
h_freShift: Hydrogen frequency offset (hz) [0-10000]
p_freShift: Phosphorus frequency offset (hz) [0-10000]
h_freDemo: Hydrogen frequency demodulation (hz) [0-10000]
p_freDemo: Phosphorus frequency demodulation (hz) [0-10000]
Analysis of experimental results
{
"result":{
"graph":[
{ # step 0
"fidRe": [[x,y],...],
"fidIm":[[x,y],...],
"fftRe":[[x,y],...],
"fftIm":[[x,y],...],
"lorenz":[[x,y],...],
"fftRe":[[x,y],...],
"fftIm":[[x,y],...],
"fftMod":[[x,y],...],
"fidMod":[[x,y],...],
"fftFit":[[x,y],...]
},
{ # step 1},
...
]
"coordinate":{
"x":0,
"y":0,
"z":1
},
"matrix": { # The density matrix of a quantum state, including its real and imaginary parts
"real": [[0.25, 0.25, 0.25, 0.25], [0.25, 0.25, 0.25, 0.25], [0.25, 0.25, 0.25, 0.25], [0.25, 0.25, 0.25, 0.25]],
"imag": [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]
},
"probability": [0.25, 0.25, 0.25, 0.25], # Probability distribution of measurement results
}
}
graph: Chart data, including real and imaginary parts, and the graph contains 2/6 steps
coordinate: Single-bit Bloch spherical coordinates (no data for dual-bit experiments)
- matrix: The density matrix of the quantum state, including the real and imaginary parts
real: real
imag: imaginary part
probability: probability distribution of measurement results