filter_functions 1.2.0__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,37 @@
1
+ # -*- coding: utf-8 -*-
2
+ # =============================================================================
3
+ # filter_functions
4
+ # Copyright (C) 2019 Quantum Technology Group, RWTH Aachen University
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU General Public License as published by
8
+ # the Free Software Foundation, either version 3 of the License, or
9
+ # (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ #
19
+ # Contact email: tobias.hangleiter@rwth-aachen.de
20
+ # =============================================================================
21
+ """Package for efficient calculation of generalized filter functions"""
22
+
23
+ from . import analytic, basis, gradient, numeric, pulse_sequence, superoperator, util
24
+ from .basis import Basis
25
+ from .gradient import infidelity_derivative
26
+ from .numeric import error_transfer_matrix, infidelity
27
+ from .pulse_sequence import PulseSequence, concatenate, concatenate_periodic, extend, remap
28
+ from .superoperator import liouville_representation
29
+
30
+ __all__ = ['Basis', 'PulseSequence', 'analytic', 'basis', 'concatenate', 'concatenate_periodic',
31
+ 'error_transfer_matrix', 'extend', 'infidelity', 'liouville_representation', 'numeric',
32
+ 'gradient', 'pulse_sequence', 'remap', 'util', 'superoperator', 'infidelity_derivative']
33
+
34
+
35
+ __version__ = '1.2.0'
36
+ __license__ = 'GNU GPLv3+'
37
+ __author__ = 'Quantum Technology Group, RWTH Aachen University'
@@ -0,0 +1,88 @@
1
+ # -*- coding: utf-8 -*-
2
+ # =============================================================================
3
+ # filter_functions
4
+ # Copyright (C) 2019 Quantum Technology Group, RWTH Aachen University
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU General Public License as published by
8
+ # the Free Software Foundation, either version 3 of the License, or
9
+ # (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ #
19
+ # Contact email: tobias.hangleiter@rwth-aachen.de
20
+ # =============================================================================
21
+ r"""
22
+ This file provides functions for the analytical solutions to some of the
23
+ dynamical decoupling sequences. Note that the filter functions given
24
+ here differ by a factor of 1/omega**2 from those defined in this package
25
+ due to different conventions. See for example [Cyw08]_. Depending on the
26
+ definition of the noise Hamiltonian one might also get different
27
+ results. The functions here agree for
28
+
29
+ .. math::
30
+
31
+ B_\alpha\equiv\sigma_z/2.
32
+
33
+ Functions
34
+ ---------
35
+ :func:`FID`
36
+ Free Induction Decay / Ramsey pulse
37
+ :func:`SE`
38
+ Spin Echo
39
+ :func:`PDD`
40
+ Periodic Dynamical Decoupling
41
+ :func:`CPMG`
42
+ Carr-Purcell-Meiboom-Gill Sequence
43
+ :func:`CDD`
44
+ Concatenated Dynamical Decoupling
45
+ :func:`UDD`
46
+ Uhrig Dynamical Decoupling
47
+
48
+ References
49
+ ----------
50
+ .. [Cyw08]
51
+ Cywiński, Ł., Lutchyn, R. M., Nave, C. P., & Das Sarma, S. (2008).
52
+ How to enhance dephasing time in superconducting qubits. Physical
53
+ Review B - Condensed Matter and Materials Physics, 77(17), 1–11.
54
+ https://doi.org/10.1103/PhysRevB.77.174509
55
+ """
56
+ import numpy as np
57
+
58
+
59
+ def FID(z):
60
+ return 2*np.sin(z/2)**2
61
+
62
+
63
+ def SE(z):
64
+ return 8*np.sin(z/4)**4
65
+
66
+
67
+ def PDD(z, n):
68
+ if n % 2 == 0:
69
+ return 2*np.tan(z/(2*n + 2))**2*np.cos(z/2)**2
70
+ else:
71
+ return 2*np.tan(z/(2*n + 2))**2*np.sin(z/2)**2
72
+
73
+
74
+ def CPMG(z, n):
75
+ if n % 2 == 0:
76
+ return 8*np.sin(z/4/n)**4*np.sin(z/2)**2/np.cos(z/2/n)**2
77
+ else:
78
+ return 8*np.sin(z/4/n)**4*np.cos(z/2)**2/np.cos(z/2/n)**2
79
+
80
+
81
+ def CDD(z, g):
82
+ return 2**(2*g + 1)*np.sin(z/2**(g + 1))**2 *\
83
+ np.prod([np.sin(z/2**(k + 1))**2 for k in range(1, g+1)], axis=0)
84
+
85
+
86
+ def UDD(z, n):
87
+ return np.abs(np.sum([(-1)**k*np.exp(1j*z/2*np.cos(np.pi*k/(n + 1)))
88
+ for k in range(-n-1, n+1)], axis=0))**2/2