Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare next release #31

Draft
wants to merge 10 commits into
base: release
Choose a base branch
from
Draft
8 changes: 0 additions & 8 deletions .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,3 @@ jobs:
run: |
python -m pytest qopt_tests --cov=qopt --cov-report=xml
# it is important to use python -m because it adds the current directory to the path!

- name: Upload code coverage
uses: codecov/codecov-action@v2
with:
file: ./coverage.xml
name: ${{ matrix.python-version }}
env_vars: OS,PYTHON
fail_ci_if_error: true
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@ qopt/examples/rabi_driving/__pycache__/lab_frame_setup.cpython-37.pyc
.coverage
coverage.xml
temp/File Name
temp/tensorflow/
doc/latexbuild/
~/tensorflow_datasets/
logs/20220823-190009/train/events.out.tfevents.1661274009.DESKTOP-29V7IHI.12928.0.v2
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be changed

doc/short_latex_build/
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
[![Documentation Status](https://img.shields.io/readthedocs/qopt)](https://qopt.readthedocs.io/en/latest/)
[![PyPI version](https://img.shields.io/pypi/v/qopt)](https://pypi.org/project/qopt/)
[![License](https://img.shields.io/github/license/qutech/qopt)](https://github.com/qutech/qopt/blob/master/LICENSE)
[![codecov](https://codecov.io/gh/qutech/qopt/branch/master/graph/badge.svg)](https://app.codecov.io/gh/qutech/qopt)

## Documentation
The documentation can be found on
Expand Down
88 changes: 48 additions & 40 deletions doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,17 @@ Summary
=======

This python package is designed to facilitate the simulation of
state-of-the-art quantum bits (qubits) including operation limitations, where
an emphasis is put on the description of realistic experimental setups.
state-of-the-art quantum bits (qubits) including realistic experimental
operation conditions, and for the optimization of noise-robust control pulses.
For this purpose, an extensive set of noise simulation tools is
included and complemented by methods to describe the limitations posed by the
electronics steering the quantum operations.

The simulation interfaces to optimization algorithms to be used in
optimal quantum control, the field of study which optimizes the accuracy of
quantum operations by intelligent steering methods.
electronics steering the quantum operations. Compared to other available
simulation packages qopt stands out by the ability to efficiently simulate the
effects of fast Non-Markovian noise, while providing a general interface to
define control pulses for any qubit type making qopt platform-independent.
The simulation interfaces to optimization algorithms to apply
optimal quantum control theory, the field of study which optimizes the
accuracy of quantum operations by intelligent steering methods.

The functionalities can be coarsely divided into simulation and optimization of
quantum operations. Various cost functions can be evaluated on the simulated
Expand All @@ -68,14 +70,12 @@ cost functions by the optimization parameters based on analytical calculations.
Simulation
----------

The evolution of a closed quantum system is described by Schroedinger's
equation, such that the dynamics are determined by the Hamiltonian of the
system. Solving Schroedinger's equation yields a description of the temporal
evolution of the quantum system.

The Hamiltonian is the sum of effects which can be controlled, those who can
not be controlled (the drift) and effects which cannot be even predicted
(the noise.)
The qopt package simulates closed or open quantum systems on a pulse level by
solving the corresponding partial differential equations being the Schroedinger
equation or a Lindblad master equation.
Thereby, pulses are discretized in time and the differential equations are
solved using matrix exponentials. The total propagator is then available for
every time step to analyse the dynamics of the qubit system.


Noise
Expand All @@ -90,20 +90,20 @@ given stating the advantages and requirements of each method.
The most forward way to simulate noise is to draw samples from the noise
distribution and repeat the simulation for each of those noise realizations.
Any cost function is then averaged over the repetitions.
The sampling is based on pseudo random number generators.
The sampling can be based on pseudo random number generators.
Monte Carlo simulations are universally applicable but computationally
expensive for high frequency noise.
expensive for high-frequency noise.


**Lindblad Master Equation**

In order to include dissipation effects in the simulation, the qubit and its
environment must be described as open quantum system, described by a master
environment can be modeled as open quantum system, described by a master
equation in Lindblad form. The solution of the master equation is in
the general case not unitary unlike the propagators calculated from
Schroedinger's equation, such that it can also describe the loss of energy or
information into the environment. This approach is numerically efficient but
only applicable to systems subjected to markovian noise.
only applicable to systems subjected to Markovian noise.

**Filter Functions**

Expand All @@ -127,10 +127,25 @@ error rate caused to leakage.
Pulse Parametrization
---------------------

In many practical applications the optimization parameters do not appear
directly as factors in the Hamiltonian. The control fields are modified by
taking limitations on the control electronics and the physical qubit model into
account.
The pulse parameterization translates a mathematically described pulse function
into discrete-time control amplitudes that appear in the Hamiltonian describing
the qubit model. This comprises sampling a potentially continuously defined
control pulse, evaluating the physical function that describes the relation
between pulse values and the control amplitudes, and including the hardware
limitations of the control electronics that generate the control pulse.


**Amplitude Functions**

The amplitude functions encode a differential relationship between the
optimization parameters, which describe the pulse, and the control amplitudes,
which appear in the Hamiltonian and describe the dynamics of the quantum
system. An example would be a sinusoidal pulse that drives resonant excitations
of a qubit. The optimization parameters would be the pulse length, the pulse
frequency and the amplitude. The amplitude function samples the continuous
pulse and maps the voltage values to energy values from the Hamiltonian,
which are the control amplitudes in this example.


**Transfer Functions**

Expand All @@ -140,15 +155,8 @@ for example exponential saturation to consider finite voltage rise times in
pulse generators, Gaussian smoothing of pulses to mimic bandwidth limitations
on arbitrary waveform generators, linear transformations or even
the measured response of an arbitrary waveform generator to a set of input
voltages.

**Amplitude Functions**

A differentiable functional relation between the optimization parameters and
the control amplitudes can be expressed in the amplitude functions. This can
for example be the exchange energy
as function of the voltage detuning in a double quantum dot
implemented in semiconductor spin qubits.
voltages. The transfer functions then map the ideal pulse to the actually
generated pulse.

Optimization
------------
Expand All @@ -173,7 +181,7 @@ Documentation
The documentation is structured in the three parts 'Features',
'Example Applications' and the 'API Documentation'.

**Features**
**qopt Features**

The first part introduces the qopt functionalities step by step. Refer to this
chapter for an introduction to the simulation package.
Expand All @@ -197,13 +205,6 @@ descriptions. During the implementation of a simulation using qopt, you can
frequently jump to the classes and functions your are using to look up the
signatures.

Citing
======

If you are using qopt for your work then please cite the
[qopt paper](https://doi.org/10.1103/PhysRevApplied.17.034036), as the funding
of the development depends on the public impact.


.. toctree::
:maxdepth: 2
Expand All @@ -213,6 +214,13 @@ of the development depends on the public impact.
examples/examples
qopt API Documentation <qopt>

Citing
======

If you are using qopt for your work then please cite the
[qopt paper](https://doi.org/10.1103/PhysRevApplied.17.034036), as the funding
of the development depends on the public impact.



Indices and tables
Expand Down
6 changes: 3 additions & 3 deletions doc/source/qopt_features/entanglement_fidelity.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
"cell_type": "markdown",
"source": [
"More information contains the gate fidelity, which describes the entire quantum gate and not only the action on a single initial state. We can set up the gate fidelity of this solver with the\n",
"$X_\\pi$-Rotation as target. The gate fidelity (equivalent to the entanglement fidelity) $I_e$ between a quantum\n",
"$X_\\pi$-Rotation as target. The entanglement fidelity (equivalent to the process fidelity) $I_e$ between a quantum\n",
"channel described by a unitary evolution $U$ and a target evolution $V$ can be\n",
"calculated as Hilbert-Schmidt vector product:\n",
"\\begin{equation}\n",
Expand Down Expand Up @@ -353,12 +353,12 @@
{
"cell_type": "markdown",
"source": [
"qopt supports the paradigm of the separation of error contributions. In this case, this means that qopt allows to separate leakage errors from coherent errors. Here we define a cost function for the coherent costs, which corrects leakage errors, by mapping the truncated unitary propagator to the closest unitary matrix before calculating the gate infidelity. The 'pure' leakage can be calculated as the distance from unitarity of the truncated propagator:\n",
"qopt supports the paradigm of the separation of error contributions. In this case, this means that qopt allows to separate leakage errors from coherent errors. Next, we define a cost function for the coherent costs, which corrects leakage errors, by mapping the truncated unitary propagator to the closest unitary matrix before calculating the gate infidelity.\n",
"\n",
"The 'pure' leakage can be calculated as the distance from unitarity of the truncated propagator:\n",
"\\begin{equation}\n",
"L = 1 - \\frac{1}{d} \\text{tr}\\left( U_{\\text{trunc}}^\\dagger U_{\\text{trunc}} \\right).\n",
"\\end{equation}\n",
"\n",
"Please note that $d$ is still the dimension of the computational space."
],
"metadata": {
Expand Down
4 changes: 2 additions & 2 deletions doc/source/qopt_features/filter_functions_basic.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@
"source": [
"## Calculate Filter Functions\n",
"\n",
"We will now discuss how to calculate filter function with the qopt interface.\n",
"We will now discuss how to calculate filter functions with the qopt interface.\n",
"\n",
"Any noise on the electrical control $\\epsilon(t)\n",
"\\rightarrow \\epsilon(t) + \\delta \\epsilon(t)$ couples to the qubit via the\n",
"noise hamiltonian\n",
"noise Hamiltonian\n",
"\n",
"\\begin{equation}\n",
"H_n= \\delta \\epsilon(t) \\frac{\\partial J(\\epsilon(t))}{\\partial \\epsilon}\\sigma_x.\n",
Expand Down
15 changes: 8 additions & 7 deletions doc/source/qopt_features/monte_carlo_experiments.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"## Quasi Static Noise\n",
"\n",
"The noise realizations required for the Monte Carlo simulations are created\n",
"in the `NoiseTraceGenerator` classes. Let us consider the case of quasi static noise\n",
"in the `NoiseTraceGenerator` classes. Let us consider the case of quasi-static noise\n",
"first:\n",
"\n"
]
Expand Down Expand Up @@ -88,9 +88,9 @@
"\n",
"The other implemented sampling mode is monte_carlo, where the noise traces are\n",
"created with help of random number generators and all random variables are\n",
"sampled at once.\n",
"sampled simultaneously.\n",
"\n",
"Next, we optimize the pulse subjected to quasi static noise. We begin with the\n",
"Next, we optimize the pulse subjected to quasi-static noise. We begin with the\n",
"same setup as in the noiseless case:"
],
"metadata": {
Expand Down Expand Up @@ -129,7 +129,7 @@
{
"cell_type": "markdown",
"source": [
"But we use a different solver."
"But we use a Monte Carlo solver."
],
"metadata": {
"collapsed": false,
Expand Down Expand Up @@ -165,18 +165,19 @@
"For the cost function, we have multiple options. We can use a cost function\n",
"which averages the entanglement infidelity\n",
"$F_e$ over the noise realizations to calculate the infidelity caused by noise\n",
"$_{n}F_e$:\n",
"$\\bar{F}_e$:\n",
"\n",
"\\begin{equation}\n",
"_nF_e = \\frac{1}{n_\\text{traces}}\\sum_{\\delta_\\omega} F\n",
"\\bar{F}_e = \\frac{1}{n_\\text{traces}}\\sum_{\\delta_\\omega} F_e(\\delta_\\omega),\n",
"\\end{equation}\n",
"where $F_e(\\delta_\\omega)$ is the infidelity evaluated for the evolution with the noise value $\\delta_\\omega$.\n",
"\n",
"This includes the stochastic (caused by noise) and the systematic (also\n",
"appearing in the absence of noise) deviations.\n",
"However, there are\n",
"certain advantages, if the stochastic and the systematic deviations are split.\n",
"It gives us a feeling for the cause of infidelities in our system, and the\n",
"optimization algorithms aquires the information, that it optimizes two cost\n",
"optimization algorithms acquires the information, that it optimizes two cost\n",
"functions at once, if a vector valued optimization algorithm is chosen."
],
"metadata": {
Expand Down
4 changes: 2 additions & 2 deletions doc/source/qopt_features/pulse_parameterization.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@
"\n",
"where $\\omega_0$ is the resonance frequency, $A(t) = v_1(t)$ the driving amplitude and\n",
"$\\delta=v_2(t)$ the phase shift of the driving signal.\n",
"We transform the Hamiltonian into the rotating frame to yield:\n",
"We transform the Hamiltonian into the rotating frame and apply the Rotating wave approximation to yield:\n",
"\n",
"\\begin{equation}\n",
"H = \\frac{ A}{2} \\text{cos} (\\delta ) \\sigma_x\n",
"+ \\frac{ A}{2} \\text{sin} (\\delta ) \\sigma_y.\n",
"\\end{equation}\n",
"\n",
"Now we identify the control amplitudes $u_1(t) = \\frac{ A}{2} \\text{cos} (\\delta )$ and $u_2(t) = \\frac{ A}{2} \\text{sin}$. We can use the class\n",
"`AmplitudeFunction` to implement the relation between the optimization/ pulse parameters and the control amplitudes.\n"
"`AmplitudeFunction` to implement the relation between the pulse parameters and the control amplitudes.\n"
]
},
{
Expand Down
Loading
Loading