Skip to content

Commit 698e723

Browse files
authored
Merge pull request #44 from qutech/feature/update_examples_for_paper
Update examples for paper
2 parents 3a3bdbc + 65cd5ce commit 698e723

13 files changed

+39465
-19323
lines changed

doc/source/_static/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.aux
2+
*.log
3+
*.pdf

doc/source/_static/qft.png

-2.78 KB
Loading

doc/source/_static/qft.tex

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
\documentclass[varwidth=false, border=10pt]{standalone}
2+
% compile with pdflatex -interaction batchmode .\qft.tex
3+
% convert with magick convert -density 300 .\qft.pdf .\qft.png
4+
\usepackage{qcircuit}
5+
\usepackage{physics}
6+
7+
\begin{document}
8+
9+
\Qcircuit @C=1em @R=1em {
10+
\lstick{3} & \qw & \qw & \qw & \qw & \qw & \ctrl{1} & \qswap & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qwa & \rstick{0} \\
11+
\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} \\
12+
\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} \\
13+
\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}
14+
}
15+
16+
\end{document}
-2 KB
Loading
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
\documentclass[varwidth=false, border=10pt]{standalone}
2+
% compile with pdflatex -interaction batchmode .\qft_HR2R3_boxed.tex
3+
% convert with magick convert -density 300 .\qft_HR2R3_boxed.pdf .\qft_HR2R3_boxed.png
4+
\usepackage{qcircuit}
5+
\usepackage{physics}
6+
7+
\begin{document}
8+
9+
\Qcircuit @C=1em @R=1em {
10+
\lstick{3} & \qw & \qw & \qw & \qw & \qw & \ctrl{1} & \qswap & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qwa & \rstick{0} \\
11+
\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} \\
12+
\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} \\
13+
\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}
14+
\gategroup{3}{2}{4}{4}{1em}{--}
15+
\gategroup{2}{5}{3}{6}{1em}{--}
16+
\gategroup{3}{9}{4}{11}{1em}{--}
17+
\gategroup{2}{12}{3}{13}{1em}{--}
18+
\gategroup{3}{14}{4}{16}{1em}{--}
19+
}
20+
21+
\end{document}
-3.84 KB
Loading
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
\documentclass[varwidth=false, border=10pt]{standalone}
2+
% compile with pdflatex -interaction batchmode .\qft_HR2R3_boxed_separately.tex
3+
% convert with magick convert -density 300 .\qft_HR2R3_boxed_separately.pdf .\qft_HR2R3_boxed_separately.png
4+
\usepackage{qcircuit}
5+
\usepackage{physics}
6+
7+
\begin{document}
8+
9+
\Qcircuit @C=1em @R=1em {
10+
\lstick{3} & \qw & \qw & \qw & \qw & \qw & \ctrl{1} & \qswap & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qwa & \rstick{0} \\
11+
\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} \\
12+
\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} \\
13+
\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}
14+
\gategroup{2}{2}{4}{6}{1em}{--}
15+
\gategroup{2}{9}{4}{13}{1em}{--}
16+
}
17+
18+
\end{document}

doc/source/_static/qft_with_echo.png

18 KB
Loading

doc/source/_static/qft_with_echo.tex

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
\documentclass[varwidth=false, border=10pt]{standalone}
2+
% compile with pdflatex -interaction batchmode .\qft_with_echo.tex
3+
% convert with magick convert -density 300 .\qft_with_echo.pdf .\qft_with_echo.png
4+
\usepackage{qcircuit}
5+
6+
\begin{document}
7+
8+
\Qcircuit @C=1em @R=1em {
9+
\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} \\
10+
\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} \\
11+
\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} \\
12+
\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}
13+
\gategroup{1}{3}{1}{3}{1em}{--}
14+
\gategroup{1}{5}{1}{5}{1em}{--}
15+
\gategroup{1}{10}{1}{10}{1em}{--}
16+
\gategroup{1}{12}{1}{12}{1em}{--}
17+
}
18+
19+
\end{document}

doc/source/examples/calculating_quantum_processes.ipynb

Lines changed: 591 additions & 13909 deletions
Large diffs are not rendered by default.

doc/source/examples/periodic_driving.ipynb

Lines changed: 871 additions & 46 deletions
Large diffs are not rendered by default.

doc/source/examples/quantum_fourier_transform.ipynb

Lines changed: 37915 additions & 5358 deletions
Large diffs are not rendered by default.

tests/test_sequencing.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -856,16 +856,17 @@ def test_caching(self):
856856

857857
# Cannot extend with basis other than Pauli, if caching is forced it
858858
# should still work
859-
extended_pulse = ff.extend([(pulse_3, 0), (pulse_3, 1)], omega=omega,
860-
cache_diagonalization=True, cache_filter_function=True)
861-
self.assertIsNotNone(extended_pulse._eigvals)
862-
self.assertIsNotNone(extended_pulse._eigvecs)
863-
self.assertIsNotNone(extended_pulse._propagators)
864-
self.assertIsNotNone(extended_pulse._total_propagator)
865-
self.assertIsNotNone(extended_pulse._total_propagator_liouville)
866-
self.assertIsNotNone(extended_pulse._total_phases)
867-
self.assertIsNotNone(extended_pulse._control_matrix)
868-
self.assertIsNotNone(extended_pulse._filter_function)
859+
with self.assertWarns(UserWarning):
860+
extended_pulse = ff.extend([(pulse_3, 0), (pulse_3, 1)], omega=omega,
861+
cache_diagonalization=True, cache_filter_function=True)
862+
self.assertIsNotNone(extended_pulse._eigvals)
863+
self.assertIsNotNone(extended_pulse._eigvecs)
864+
self.assertIsNotNone(extended_pulse._propagators)
865+
self.assertIsNotNone(extended_pulse._total_propagator)
866+
self.assertIsNotNone(extended_pulse._total_propagator_liouville)
867+
self.assertIsNotNone(extended_pulse._total_phases)
868+
self.assertIsNotNone(extended_pulse._control_matrix)
869+
self.assertIsNotNone(extended_pulse._filter_function)
869870

870871
def test_accuracy(self):
871872
ID, X, Y, Z = util.paulis

0 commit comments

Comments
 (0)