Skip to content

Commit

Permalink
Merge pull request #19 from qutech/hotfix/documentation
Browse files Browse the repository at this point in the history
Small fixes to documentation
  • Loading branch information
thangleiter authored Apr 7, 2020
2 parents 7fddd61 + 1aad051 commit c25d04a
Show file tree
Hide file tree
Showing 7 changed files with 2,380 additions and 35,220 deletions.
14,507 changes: 734 additions & 13,773 deletions doc/source/examples/calculating_error_transfer_matrices.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion doc/source/examples/extending_pulses.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"and the extend pulse has the following control and noise operators:"
"and the extended pulse has the following control and noise operators:"
]
},
{
Expand Down
24 changes: 13 additions & 11 deletions doc/source/examples/getting_started.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
"The `PulseSequence` class requires three positional arguments at instantiation; `H_c`, `H_n`, and `dt`, with `dt` the time-deltas of piece-wise constant control. The former two represent the control and noise Hamiltonians and are passed in the same nested-list-of-lists structure of operators and coefficient lists similar to that required by [QuTiP](http://qutip.org/) (the difference being that QuTiP requires implicit functions for calculating the coefficients instead of explicit values). Optionally, we pass unique identifiers for each operator as a third element of the list. That is, \n",
"\n",
"```python\n",
" H = [[oper1, coeff1, identifier1],\n",
" [oper2, coeff2, identifier2], ...]\n",
" H = [[oper1, coeffs1, identifier1],\n",
" [oper2, coeffs2, identifier2], ...]\n",
"```\n",
"\n",
"The filter function can then be calculated by calling the `get_filter_function` method of the `PulseSequence` instance with a list of frequencies.\n"
Expand Down Expand Up @@ -77,8 +77,8 @@
"\n",
"# Control Hamiltonian\n",
"H_c = [\n",
" [X/2, [0], 'X'], # We don't apply any control\n",
" [Z/2, [4*np.pi], 'Z'] # Qubit splitting, hbar == 1\n",
" [X/2, [0], 'X'], # We don't apply any control\n",
" [Z/2, [4*np.pi], 'Z'] # Qubit splitting, hbar == 1\n",
"]\n",
"\n",
"# Noise Hamiltonian\n",
Expand Down Expand Up @@ -135,7 +135,8 @@
"# Plot the filter function.\n",
"fig, ax, legend = ff.plot_filter_function(FID, omega)\n",
"# Plot the analytic solution into the same plot\n",
"ax.plot(omega*tau, analytic.FID(omega*tau)/omega**2, 'x', label='Analytical')\n",
"ax.plot(omega*tau, analytic.FID(omega*tau)/omega**2,\n",
" 'x-', label='Analytical', zorder=0)\n",
"# Update legend\n",
"legend = ax.legend()"
]
Expand Down Expand Up @@ -234,13 +235,14 @@
"metadata": {},
"outputs": [],
"source": [
"omega = ff.util.get_sample_frequencies(SE, n_samples=200, spacing='log',\n",
"omega = ff.util.get_sample_frequencies(SE, n_samples=400, spacing='log',\n",
" symmetric=False)\n",
"# Plot the filter function\n",
"fig, ax, legend = ff.plot_filter_function(SE, omega)\n",
"fig, ax, legend = ff.plot_filter_function(SE, omega, yscale='log')\n",
"ax.set_ylim(bottom=1e-13)\n",
"# Plot the analytical solution\n",
"ax.plot(omega*tau, analytic.SE(omega*tau)/omega**2, 'x',\n",
" label='Analytical (Bang-Bang)')\n",
"ax.plot(omega*tau, analytic.SE(omega*tau)/omega**2, '--',\n",
" label='Analytical (Bang-Bang)', zorder=0)\n",
"legend = ax.legend()\n",
"\n",
"ff.plot_bloch_vector_evolution(SE, psi0=psi_i, n_samples=101, figsize=(4, 4))"
Expand All @@ -250,7 +252,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"The discrepancy to the analytical solution is due to the finite pulse width we have chosen here. We can see that, contrary to the FID-like filter function along $\\sigma_x$, the dephasing filter function of the SE pulse drops to (almost) zero for DC noise, affirming that indeed the pulse enhances coherence as it filters out frequencies slower than the pulse duration."
"The discrepancy to the analytical solution is due to the finite pulse width we have chosen here. We can see that, contrary to the FID-like filter function along $\\sigma_x$, the dephasing filter function of the SE pulse drops to (almost) zero for DC noise, affirming that indeed the pulse cancels dephasing as it filters out noise frequencies slower than the pulse duration."
]
}
],
Expand All @@ -274,5 +276,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
3,728 changes: 242 additions & 3,486 deletions doc/source/examples/periodic_driving.ipynb

Large diffs are not rendered by default.

19,327 changes: 1,383 additions & 17,944 deletions doc/source/examples/quantum_fourier_transform.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion doc/source/examples/qutip_integration.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Evidently, the pulses with linear and random initial amplitudes filter out DC noise better than those with sinusoidal initial amplitudes, in particular for $\\sigma_y$ noise on the first qubit. There, they they acquire a DCG-like character to an extent."
"Evidently, the pulses with linear and random initial amplitudes filter out DC noise better than those with sinusoidal initial amplitudes, in particular for $\\sigma_y$ noise on the first qubit. There, the filter function has DCG-like character to an extent."
]
}
],
Expand Down
10 changes: 6 additions & 4 deletions filter_functions/pulse_sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -1356,8 +1356,8 @@ def concatenate(pulses: Iterable[PulseSequence],
calculation of the composite filter function is forced.
calc_pulse_correlation_ff : bool, optional
Switch to control whether the pulse correlation filter function (see
:ref:`notes`) is calculated. If *omega* is not given, the cached
frequencies of all *pulses* need to be equal.
:ref:`Notes <notes>`) is calculated. If *omega* is not given, the
cached frequencies of all *pulses* need to be equal.
calc_filter_function : bool, optional
Switch to force the calculation of the filter function to be carried
out or not. Overrides the automatic behavior of calculating it if at
Expand All @@ -1384,8 +1384,10 @@ def concatenate(pulses: Iterable[PulseSequence],
.. math::
F_{\alpha\beta}^{(gg')}(\omega) = e^{i\omega(t_{g-1} - t_{g'-1})}
\mathcal{R}^{(g)}(\omega)\mathcal{Q}^{(g-1)}
\mathcal{Q}^{(g'-1)\dagger}\mathcal{R}^{(g')\dagger}(\omega),
\left[\mathcal{Q}^{(g'-1)\dagger}
\mathcal{R}^{(g')\dagger}(\omega)\right]_{k\alpha}
\left[\mathcal{R}^{(g)}(\omega)
\mathcal{Q}^{(g-1)}\right]_{\beta l},
where :math:`g,g'` index the pulse in the sequence and :math:`\alpha,\beta`
index the noise operators.
Expand Down

0 comments on commit c25d04a

Please sign in to comment.