Skip to content

Commit

Permalink
Merge pull request #44 from qutech/feature/update_examples_for_paper
Browse files Browse the repository at this point in the history
Update examples for paper
  • Loading branch information
thangleiter committed Feb 1, 2021
2 parents 3a3bdbc + 65cd5ce commit 698e723
Show file tree
Hide file tree
Showing 13 changed files with 39,465 additions and 19,323 deletions.
3 changes: 3 additions & 0 deletions doc/source/_static/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.aux
*.log
*.pdf
Binary file modified doc/source/_static/qft.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions doc/source/_static/qft.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
\documentclass[varwidth=false, border=10pt]{standalone}
% compile with pdflatex -interaction batchmode .\qft.tex
% convert with magick convert -density 300 .\qft.pdf .\qft.png
\usepackage{qcircuit}
\usepackage{physics}

\begin{document}

\Qcircuit @C=1em @R=1em {
\lstick{3} & \qw & \qw & \qw & \qw & \qw & \ctrl{1} & \qswap & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qwa & \rstick{0} \\
\lstick{2} & \qw & \qw & \qw & \ctrl{1} & \qswap & \gate{R_4} & \qswap\qwx & \qw & \qw & \qw & \ctrl{1} & \qswap & \qw & \qw & \qw & \qw & \qwa & \rstick{1} \\
\lstick{1} & \qw & \ctrl{1} & \qswap & \gate{R_3} & \qswap\qwx & \qw & \qw & \qw & \ctrl{1} & \qswap & \gate{R_3} & \qswap\qwx & \qw & \ctrl{1} & \qswap & \qw & \qwa & \rstick{2} \\
\lstick{0} & \gate{H} & \gate{R_2} & \qswap\qwx & \qw & \qw & \qw & \qw & \gate{H} & \gate{R_2} & \qswap\qwx & \qw & \qw & \gate{H} & \gate{R_2} & \qswap\qwx & \gate{H} & \qwa & \rstick{3}
}

\end{document}
Binary file modified doc/source/_static/qft_HR2R3_boxed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions doc/source/_static/qft_HR2R3_boxed.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
\documentclass[varwidth=false, border=10pt]{standalone}
% compile with pdflatex -interaction batchmode .\qft_HR2R3_boxed.tex
% convert with magick convert -density 300 .\qft_HR2R3_boxed.pdf .\qft_HR2R3_boxed.png
\usepackage{qcircuit}
\usepackage{physics}

\begin{document}

\Qcircuit @C=1em @R=1em {
\lstick{3} & \qw & \qw & \qw & \qw & \qw & \ctrl{1} & \qswap & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qwa & \rstick{0} \\
\lstick{2} & \qw & \qw & \qw & \ctrl{1} & \qswap & \gate{R_4} & \qswap\qwx & \qw & \qw & \qw & \ctrl{1} & \qswap & \qw & \qw & \qw & \qw & \qwa & \rstick{1} \\
\lstick{1} & \qw & \ctrl{1} & \qswap & \gate{R_3} & \qswap\qwx & \qw & \qw & \qw & \ctrl{1} & \qswap & \gate{R_3} & \qswap\qwx & \qw & \ctrl{1} & \qswap & \qw & \qwa & \rstick{2} \\
\lstick{0} & \gate{H} & \gate{R_2} & \qswap\qwx & \qw & \qw & \qw & \qw & \gate{H} & \gate{R_2} & \qswap\qwx & \qw & \qw & \gate{H} & \gate{R_2} & \qswap\qwx & \gate{H} & \qwa & \rstick{3}
\gategroup{3}{2}{4}{4}{1em}{--}
\gategroup{2}{5}{3}{6}{1em}{--}
\gategroup{3}{9}{4}{11}{1em}{--}
\gategroup{2}{12}{3}{13}{1em}{--}
\gategroup{3}{14}{4}{16}{1em}{--}
}

\end{document}
Binary file modified doc/source/_static/qft_HR2R3_boxed_separately.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions doc/source/_static/qft_HR2R3_boxed_separately.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
\documentclass[varwidth=false, border=10pt]{standalone}
% compile with pdflatex -interaction batchmode .\qft_HR2R3_boxed_separately.tex
% convert with magick convert -density 300 .\qft_HR2R3_boxed_separately.pdf .\qft_HR2R3_boxed_separately.png
\usepackage{qcircuit}
\usepackage{physics}

\begin{document}

\Qcircuit @C=1em @R=1em {
\lstick{3} & \qw & \qw & \qw & \qw & \qw & \ctrl{1} & \qswap & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qwa & \rstick{0} \\
\lstick{2} & \qw & \qw & \qw & \ctrl{1} & \qswap & \gate{R_4} & \qswap\qwx & \qw & \qw & \qw & \ctrl{1} & \qswap & \qw & \qw & \qw & \qw & \qwa & \rstick{1} \\
\lstick{1} & \qw & \ctrl{1} & \qswap & \gate{R_3} & \qswap\qwx & \qw & \qw & \qw & \ctrl{1} & \qswap & \gate{R_3} & \qswap\qwx & \qw & \ctrl{1} & \qswap & \qw & \qwa & \rstick{2} \\
\lstick{0} & \gate{H} & \gate{R_2} & \qswap\qwx & \qw & \qw & \qw & \qw & \gate{H} & \gate{R_2} & \qswap\qwx & \qw & \qw & \gate{H} & \gate{R_2} & \qswap\qwx & \gate{H} & \qwa & \rstick{3}
\gategroup{2}{2}{4}{6}{1em}{--}
\gategroup{2}{9}{4}{13}{1em}{--}
}

\end{document}
Binary file added doc/source/_static/qft_with_echo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions doc/source/_static/qft_with_echo.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
\documentclass[varwidth=false, border=10pt]{standalone}
% compile with pdflatex -interaction batchmode .\qft_with_echo.tex
% convert with magick convert -density 300 .\qft_with_echo.pdf .\qft_with_echo.png
\usepackage{qcircuit}

\begin{document}

\Qcircuit @C=1em @R=1em {
\lstick{3} & \qw & \gate{X} & \qw & \gate{X} & \qw & \ctrl{1} & \qswap & \qw & \gate{X} & \qw & \gate{X} & \qw & \qw & \qw & \qw & \qw & \qwa & \rstick{0} \\
\lstick{2} & \qw & \qw & \qw & \ctrl{1} & \qswap & \gate{R_4} & \qswap\qwx & \qw & \qw & \qw & \ctrl{1} & \qswap & \qw & \qw & \qw & \qw & \qwa & \rstick{1} \\
\lstick{1} & \qw & \ctrl{1} & \qswap & \gate{R_3} & \qswap\qwx & \qw & \qw & \qw & \ctrl{1} & \qswap & \gate{R_3} & \qswap\qwx & \qw & \ctrl{1} & \qswap & \qw & \qwa & \rstick{2} \\
\lstick{0} & \gate{H} & \gate{R_2} & \qswap\qwx & \qw & \qw & \qw & \qw & \gate{H} & \gate{R_2} & \qswap\qwx & \qw & \qw & \gate{H} & \gate{R_2} & \qswap\qwx & \gate{H} & \qwa & \rstick{3}
\gategroup{1}{3}{1}{3}{1em}{--}
\gategroup{1}{5}{1}{5}{1em}{--}
\gategroup{1}{10}{1}{10}{1em}{--}
\gategroup{1}{12}{1}{12}{1em}{--}
}

\end{document}
14,500 changes: 591 additions & 13,909 deletions doc/source/examples/calculating_quantum_processes.ipynb

Large diffs are not rendered by default.

917 changes: 871 additions & 46 deletions doc/source/examples/periodic_driving.ipynb

Large diffs are not rendered by default.

43,273 changes: 37,915 additions & 5,358 deletions doc/source/examples/quantum_fourier_transform.ipynb

Large diffs are not rendered by default.

21 changes: 11 additions & 10 deletions tests/test_sequencing.py
Original file line number Diff line number Diff line change
Expand Up @@ -856,16 +856,17 @@ def test_caching(self):

# Cannot extend with basis other than Pauli, if caching is forced it
# should still work
extended_pulse = ff.extend([(pulse_3, 0), (pulse_3, 1)], omega=omega,
cache_diagonalization=True, cache_filter_function=True)
self.assertIsNotNone(extended_pulse._eigvals)
self.assertIsNotNone(extended_pulse._eigvecs)
self.assertIsNotNone(extended_pulse._propagators)
self.assertIsNotNone(extended_pulse._total_propagator)
self.assertIsNotNone(extended_pulse._total_propagator_liouville)
self.assertIsNotNone(extended_pulse._total_phases)
self.assertIsNotNone(extended_pulse._control_matrix)
self.assertIsNotNone(extended_pulse._filter_function)
with self.assertWarns(UserWarning):
extended_pulse = ff.extend([(pulse_3, 0), (pulse_3, 1)], omega=omega,
cache_diagonalization=True, cache_filter_function=True)
self.assertIsNotNone(extended_pulse._eigvals)
self.assertIsNotNone(extended_pulse._eigvecs)
self.assertIsNotNone(extended_pulse._propagators)
self.assertIsNotNone(extended_pulse._total_propagator)
self.assertIsNotNone(extended_pulse._total_propagator_liouville)
self.assertIsNotNone(extended_pulse._total_phases)
self.assertIsNotNone(extended_pulse._control_matrix)
self.assertIsNotNone(extended_pulse._filter_function)

def test_accuracy(self):
ID, X, Y, Z = util.paulis
Expand Down

0 comments on commit 698e723

Please sign in to comment.