surface-ion 1.0.1__tar.gz
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.
- surface-ion-1.0.1/LICENSE +21 -0
- surface-ion-1.0.1/MANIFEST.in +7 -0
- surface-ion-1.0.1/PKG-INFO +67 -0
- surface-ion-1.0.1/readme.md +42 -0
- surface-ion-1.0.1/setup.cfg +21 -0
- surface-ion-1.0.1/setup.py +53 -0
- surface-ion-1.0.1/surface_ion.egg-info/PKG-INFO +67 -0
- surface-ion-1.0.1/surface_ion.egg-info/SOURCES.txt +13 -0
- surface-ion-1.0.1/surface_ion.egg-info/dependency_links.txt +1 -0
- surface-ion-1.0.1/surface_ion.egg-info/requires.txt +10 -0
- surface-ion-1.0.1/surface_ion.egg-info/top_level.txt +1 -0
- surface-ion-1.0.1/tests/FiveWireSimulation.py +157 -0
- surface-ion-1.0.1/tests/RingSimulation.py +92 -0
- surface-ion-1.0.1/tests/stability.ipynb +488 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 underforestaaa
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: surface-ion
|
|
3
|
+
Version: 1.0.1
|
|
4
|
+
Summary: Python package for simulation and analysis of ion crystals in surface traps.
|
|
5
|
+
Author: Artem Podlesnyy
|
|
6
|
+
Author-email: a.podlesnyy@rqc.ru
|
|
7
|
+
License: MIT license
|
|
8
|
+
Keywords: surface trap,ion,quantum computing,ion simulation,normal modes,mathieu modes,ion shuttling,voltage optimization
|
|
9
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Natural Language :: English
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.6
|
|
14
|
+
License-File: LICENSE
|
|
15
|
+
Requires-Dist: numpy>=1.13.3
|
|
16
|
+
Requires-Dist: jinja2>=2.9.6
|
|
17
|
+
Requires-Dist: scipy>=1.12.1
|
|
18
|
+
Requires-Dist: scikit-optimize>=0.10.2
|
|
19
|
+
Requires-Dist: electrode>=1.4
|
|
20
|
+
Requires-Dist: matplotlib>=3.9.2
|
|
21
|
+
Requires-Dist: gdspy>=1.6.13
|
|
22
|
+
Requires-Dist: shapely>=2.0.6
|
|
23
|
+
Requires-Dist: tqdm>=4.66.6
|
|
24
|
+
Requires-Dist: wexpect
|
|
25
|
+
|
|
26
|
+
# *Sion* package
|
|
27
|
+
|
|
28
|
+
Python package for simulation and analysis of ion crystals in surface electrode traps.
|
|
29
|
+
|
|
30
|
+
## Installation
|
|
31
|
+
|
|
32
|
+
To use *Sion*, the following packages are required to be installed from source and tested:
|
|
33
|
+
- [pylion package](https://bitbucket.org/dtrypogeorgos/pylion/src/master/): LAMMPS wrapper for ion dynamics simulation. This package requires installation of LAMMPS software with the specific version. It will work well with the latest LAMMPS version, if in source file *pylion.py* at line 51 you change "lmp_serial" to "lmp".
|
|
34
|
+
- [electrode package](https://github.com/nist-ionstorage/electrode): Python package for convenient definition and analysis of surface electrode traps.
|
|
35
|
+
!Note: for correct execution of these packages, numpy<=1.21.0 is recquired. Alternatively one may install
|
|
36
|
+
|
|
37
|
+
The newest version may be installed via pip:
|
|
38
|
+
<code>pip install surface-ion</code>
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
## Getting started
|
|
42
|
+
|
|
43
|
+
*Sion* works with surface traps, defined through the *electrode* package. The simulation of ion dynamics is carried through the *pylion* environment.
|
|
44
|
+
All functions, presented in *Sion* are described in example notebooks. Main file *sion.py* containes docs for each function.
|
|
45
|
+
|
|
46
|
+
To publish the results, obtained with *Sion*, the following articles should be cited:
|
|
47
|
+
1. [Surface trap with adjustable ion couplings for scalable and parallel gates](https://journals.aps.org/pra/abstract/10.1103/PhysRevA.109.022605)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
## Features
|
|
51
|
+
* Simulation of ion motion in arbitrary polygon and point electrode surface trap.
|
|
52
|
+
* Optimization and simulation of arbitrary ion shuttling in polygon traps.
|
|
53
|
+
* Calculation of normal modes for general case of 1D, 2D, 3D mixed species ion crystals with arbitrary set of ions' secular frequencies.
|
|
54
|
+
* Calculation of anharmonic mathieu modes of ion crystals in surface traps.
|
|
55
|
+
* Stability analysis of asymmetric planar traps.
|
|
56
|
+
* Optimization of DC voltage set of a planar trap to match the desired secular frequency and radial mode rotation angle in given positions.
|
|
57
|
+
* Convenient trap design. Layout may be imported from GDS file or created by defining the arbitrary electrode shape boundary.
|
|
58
|
+
|
|
59
|
+
## File structure
|
|
60
|
+
|
|
61
|
+
* 'build/lib/sion.py': contains all the main functions.
|
|
62
|
+
|
|
63
|
+
* 'examples': examples showing different features of *Sion*.
|
|
64
|
+
|
|
65
|
+
* 'tests': verifications and tests of *Sion* work.
|
|
66
|
+
|
|
67
|
+
Free software: MIT license
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# *Sion* package
|
|
2
|
+
|
|
3
|
+
Python package for simulation and analysis of ion crystals in surface electrode traps.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
To use *Sion*, the following packages are required to be installed from source and tested:
|
|
8
|
+
- [pylion package](https://bitbucket.org/dtrypogeorgos/pylion/src/master/): LAMMPS wrapper for ion dynamics simulation. This package requires installation of LAMMPS software with the specific version. It will work well with the latest LAMMPS version, if in source file *pylion.py* at line 51 you change "lmp_serial" to "lmp".
|
|
9
|
+
- [electrode package](https://github.com/nist-ionstorage/electrode): Python package for convenient definition and analysis of surface electrode traps.
|
|
10
|
+
!Note: for correct execution of these packages, numpy<=1.21.0 is recquired. Alternatively one may install
|
|
11
|
+
|
|
12
|
+
The newest version may be installed via pip:
|
|
13
|
+
<code>pip install surface-ion</code>
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## Getting started
|
|
17
|
+
|
|
18
|
+
*Sion* works with surface traps, defined through the *electrode* package. The simulation of ion dynamics is carried through the *pylion* environment.
|
|
19
|
+
All functions, presented in *Sion* are described in example notebooks. Main file *sion.py* containes docs for each function.
|
|
20
|
+
|
|
21
|
+
To publish the results, obtained with *Sion*, the following articles should be cited:
|
|
22
|
+
1. [Surface trap with adjustable ion couplings for scalable and parallel gates](https://journals.aps.org/pra/abstract/10.1103/PhysRevA.109.022605)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## Features
|
|
26
|
+
* Simulation of ion motion in arbitrary polygon and point electrode surface trap.
|
|
27
|
+
* Optimization and simulation of arbitrary ion shuttling in polygon traps.
|
|
28
|
+
* Calculation of normal modes for general case of 1D, 2D, 3D mixed species ion crystals with arbitrary set of ions' secular frequencies.
|
|
29
|
+
* Calculation of anharmonic mathieu modes of ion crystals in surface traps.
|
|
30
|
+
* Stability analysis of asymmetric planar traps.
|
|
31
|
+
* Optimization of DC voltage set of a planar trap to match the desired secular frequency and radial mode rotation angle in given positions.
|
|
32
|
+
* Convenient trap design. Layout may be imported from GDS file or created by defining the arbitrary electrode shape boundary.
|
|
33
|
+
|
|
34
|
+
## File structure
|
|
35
|
+
|
|
36
|
+
* 'build/lib/sion.py': contains all the main functions.
|
|
37
|
+
|
|
38
|
+
* 'examples': examples showing different features of *Sion*.
|
|
39
|
+
|
|
40
|
+
* 'tests': verifications and tests of *Sion* work.
|
|
41
|
+
|
|
42
|
+
Free software: MIT license
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
[bumpversion]
|
|
2
|
+
current_version = 1.0.0
|
|
3
|
+
commit = True
|
|
4
|
+
tag = True
|
|
5
|
+
|
|
6
|
+
[bumpversion:file:setup.py]
|
|
7
|
+
search = version='{current_version}'
|
|
8
|
+
replace = version='{new_version}'
|
|
9
|
+
|
|
10
|
+
[bumpversion:file:sion/sion.py]
|
|
11
|
+
search = __version__ = '{current_version}'
|
|
12
|
+
replace = __version__ = '{new_version}'
|
|
13
|
+
|
|
14
|
+
[tool:pytest]
|
|
15
|
+
markers =
|
|
16
|
+
slow: marks tests as slow (deselect with '-m "not slow"')
|
|
17
|
+
|
|
18
|
+
[egg_info]
|
|
19
|
+
tag_build =
|
|
20
|
+
tag_date = 0
|
|
21
|
+
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
from setuptools import setup, find_packages
|
|
3
|
+
|
|
4
|
+
# install wexpect if windows
|
|
5
|
+
if 'win32' in sys.platform:
|
|
6
|
+
expect = ['wexpect']
|
|
7
|
+
else:
|
|
8
|
+
expect = ['pexpect>=4.2.1']
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
with open('readme.md') as readme_file:
|
|
12
|
+
readme = readme_file.read()
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
requirements = [
|
|
16
|
+
'numpy>=1.13.3',
|
|
17
|
+
'jinja2>=2.9.6',
|
|
18
|
+
'scipy>=1.12.1',
|
|
19
|
+
'scikit-optimize>=0.10.2',
|
|
20
|
+
'electrode>=1.4',
|
|
21
|
+
'matplotlib>=3.9.2',
|
|
22
|
+
'gdspy>=1.6.13',
|
|
23
|
+
'shapely>=2.0.6',
|
|
24
|
+
'tqdm>=4.66.6'
|
|
25
|
+
] + expect
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
short_description = (
|
|
29
|
+
"Python package for simulation and analysis of ion crystals in surface traps.")
|
|
30
|
+
|
|
31
|
+
setup(
|
|
32
|
+
name='surface-ion',
|
|
33
|
+
version='1.0.1',
|
|
34
|
+
description=short_description,
|
|
35
|
+
long_description=readme,
|
|
36
|
+
author="Artem Podlesnyy",
|
|
37
|
+
author_email='a.podlesnyy@rqc.ru',
|
|
38
|
+
packages=find_packages(include=['surface-ion']),
|
|
39
|
+
package_data={'surface-ion': ['templates/*j2']},
|
|
40
|
+
include_package_data=True,
|
|
41
|
+
install_requires=requirements,
|
|
42
|
+
license="MIT license",
|
|
43
|
+
keywords=['surface trap', 'ion', 'quantum computing', 'ion simulation',
|
|
44
|
+
'normal modes', 'mathieu modes', 'ion shuttling', 'voltage optimization'],
|
|
45
|
+
classifiers=[
|
|
46
|
+
'Development Status :: 2 - Pre-Alpha',
|
|
47
|
+
'Intended Audience :: Developers',
|
|
48
|
+
'License :: OSI Approved :: MIT License',
|
|
49
|
+
'Natural Language :: English',
|
|
50
|
+
'Programming Language :: Python :: 3.6',
|
|
51
|
+
],
|
|
52
|
+
test_suite='tests',
|
|
53
|
+
)
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: surface-ion
|
|
3
|
+
Version: 1.0.1
|
|
4
|
+
Summary: Python package for simulation and analysis of ion crystals in surface traps.
|
|
5
|
+
Author: Artem Podlesnyy
|
|
6
|
+
Author-email: a.podlesnyy@rqc.ru
|
|
7
|
+
License: MIT license
|
|
8
|
+
Keywords: surface trap,ion,quantum computing,ion simulation,normal modes,mathieu modes,ion shuttling,voltage optimization
|
|
9
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Natural Language :: English
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.6
|
|
14
|
+
License-File: LICENSE
|
|
15
|
+
Requires-Dist: numpy>=1.13.3
|
|
16
|
+
Requires-Dist: jinja2>=2.9.6
|
|
17
|
+
Requires-Dist: scipy>=1.12.1
|
|
18
|
+
Requires-Dist: scikit-optimize>=0.10.2
|
|
19
|
+
Requires-Dist: electrode>=1.4
|
|
20
|
+
Requires-Dist: matplotlib>=3.9.2
|
|
21
|
+
Requires-Dist: gdspy>=1.6.13
|
|
22
|
+
Requires-Dist: shapely>=2.0.6
|
|
23
|
+
Requires-Dist: tqdm>=4.66.6
|
|
24
|
+
Requires-Dist: wexpect
|
|
25
|
+
|
|
26
|
+
# *Sion* package
|
|
27
|
+
|
|
28
|
+
Python package for simulation and analysis of ion crystals in surface electrode traps.
|
|
29
|
+
|
|
30
|
+
## Installation
|
|
31
|
+
|
|
32
|
+
To use *Sion*, the following packages are required to be installed from source and tested:
|
|
33
|
+
- [pylion package](https://bitbucket.org/dtrypogeorgos/pylion/src/master/): LAMMPS wrapper for ion dynamics simulation. This package requires installation of LAMMPS software with the specific version. It will work well with the latest LAMMPS version, if in source file *pylion.py* at line 51 you change "lmp_serial" to "lmp".
|
|
34
|
+
- [electrode package](https://github.com/nist-ionstorage/electrode): Python package for convenient definition and analysis of surface electrode traps.
|
|
35
|
+
!Note: for correct execution of these packages, numpy<=1.21.0 is recquired. Alternatively one may install
|
|
36
|
+
|
|
37
|
+
The newest version may be installed via pip:
|
|
38
|
+
<code>pip install surface-ion</code>
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
## Getting started
|
|
42
|
+
|
|
43
|
+
*Sion* works with surface traps, defined through the *electrode* package. The simulation of ion dynamics is carried through the *pylion* environment.
|
|
44
|
+
All functions, presented in *Sion* are described in example notebooks. Main file *sion.py* containes docs for each function.
|
|
45
|
+
|
|
46
|
+
To publish the results, obtained with *Sion*, the following articles should be cited:
|
|
47
|
+
1. [Surface trap with adjustable ion couplings for scalable and parallel gates](https://journals.aps.org/pra/abstract/10.1103/PhysRevA.109.022605)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
## Features
|
|
51
|
+
* Simulation of ion motion in arbitrary polygon and point electrode surface trap.
|
|
52
|
+
* Optimization and simulation of arbitrary ion shuttling in polygon traps.
|
|
53
|
+
* Calculation of normal modes for general case of 1D, 2D, 3D mixed species ion crystals with arbitrary set of ions' secular frequencies.
|
|
54
|
+
* Calculation of anharmonic mathieu modes of ion crystals in surface traps.
|
|
55
|
+
* Stability analysis of asymmetric planar traps.
|
|
56
|
+
* Optimization of DC voltage set of a planar trap to match the desired secular frequency and radial mode rotation angle in given positions.
|
|
57
|
+
* Convenient trap design. Layout may be imported from GDS file or created by defining the arbitrary electrode shape boundary.
|
|
58
|
+
|
|
59
|
+
## File structure
|
|
60
|
+
|
|
61
|
+
* 'build/lib/sion.py': contains all the main functions.
|
|
62
|
+
|
|
63
|
+
* 'examples': examples showing different features of *Sion*.
|
|
64
|
+
|
|
65
|
+
* 'tests': verifications and tests of *Sion* work.
|
|
66
|
+
|
|
67
|
+
Free software: MIT license
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
MANIFEST.in
|
|
3
|
+
readme.md
|
|
4
|
+
setup.cfg
|
|
5
|
+
setup.py
|
|
6
|
+
surface_ion.egg-info/PKG-INFO
|
|
7
|
+
surface_ion.egg-info/SOURCES.txt
|
|
8
|
+
surface_ion.egg-info/dependency_links.txt
|
|
9
|
+
surface_ion.egg-info/requires.txt
|
|
10
|
+
surface_ion.egg-info/top_level.txt
|
|
11
|
+
tests/FiveWireSimulation.py
|
|
12
|
+
tests/RingSimulation.py
|
|
13
|
+
tests/stability.ipynb
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Example, containing definition and simulation of the five-wire trap with
|
|
3
|
+
three electrodes, containing 5 Ca ions.
|
|
4
|
+
Additionally, normal modes of the linear ion chain is calculated with
|
|
5
|
+
axial_ and radial_normal_modes(), and verified with theoretical analysis.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import division
|
|
9
|
+
import pylion as pl
|
|
10
|
+
from pathlib import Path
|
|
11
|
+
import matplotlib.pyplot as plt, numpy as np, scipy.constants as ct
|
|
12
|
+
from electrode import (System, PolygonPixelElectrode, euler_matrix,
|
|
13
|
+
PointPixelElectrode, PotentialObjective,
|
|
14
|
+
PatternRangeConstraint, shaped)
|
|
15
|
+
import sion as sn
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
if __name__ == "__main__":
|
|
20
|
+
# Global definition of trap parameters.
|
|
21
|
+
L = 1e-6 # length scale
|
|
22
|
+
Vrf = 200. # RF peak voltage in V
|
|
23
|
+
mass = 40*ct.atomic_mass # ion mass
|
|
24
|
+
Z = 1*ct.elementary_charge # ion charge
|
|
25
|
+
Omega = 2*np.pi*30e6 # RF frequency in rad/s
|
|
26
|
+
Urf = Vrf * np.sqrt(Z / mass) / (2 * L * Omega)
|
|
27
|
+
scale = Z / ((L * Omega) ** 2 * mass)
|
|
28
|
+
|
|
29
|
+
# parameters of trap
|
|
30
|
+
DCtop = [[600, 760],[400, 760],[600, 760 ]] # Array of lengths and widths of Top electrodes
|
|
31
|
+
DCbottom = [[600, 760],[400, 760],[600, 760]] # Array of lengths and widths of Bottom electrodes
|
|
32
|
+
c = [6000, 140] # Width of central dc electrode
|
|
33
|
+
rftop = [6000, 100] # width of top rf electrode, not including width of central electrode
|
|
34
|
+
rfbottom = [6000, 240] # width of bottom rf electrode
|
|
35
|
+
|
|
36
|
+
sist, RF_electrodes, DC_electrodes = sn.five_wire_trap_design(Urf, DCtop ,DCbottom, rftop, rfbottom, c, need_coordinates = True, need_plot=True)
|
|
37
|
+
|
|
38
|
+
x0 = L*np.array(sist.minimum((0., 2, 3), axis=(0, 1, 2), coord=np.identity(3), method="Newton-CG"))
|
|
39
|
+
u_set = np.array([ 0, 0, 1.82122328, 7.77948793, -0.78451288, 7.77937332, 7.73905658, -7.90762408, 7.73944278])
|
|
40
|
+
dc_set = u_set[2:]
|
|
41
|
+
|
|
42
|
+
# routine to find secular frequencies in minimum point
|
|
43
|
+
with sist.with_voltages(dcs=u_set, rfs=None):
|
|
44
|
+
# Check if the minimum was shifted
|
|
45
|
+
x = sist.minimum((0., 90, 120), axis=(0, 1, 2), coord=np.identity(3), method="Newton-CG")
|
|
46
|
+
curv_z, mod_dir = sist.modes(x, sorted=False)
|
|
47
|
+
omega_sec = np.sqrt(Z * curv_z / mass) / (L * 2 * np.pi) * 1e-6
|
|
48
|
+
omega_sec *=1e6
|
|
49
|
+
|
|
50
|
+
ion_number = 5
|
|
51
|
+
x0 = x*1e-6
|
|
52
|
+
|
|
53
|
+
"""Simulation"""
|
|
54
|
+
|
|
55
|
+
#insert your path to this file here
|
|
56
|
+
name = Path(__file__).stem
|
|
57
|
+
|
|
58
|
+
s = pl.Simulation(name)
|
|
59
|
+
|
|
60
|
+
#ions' declaration
|
|
61
|
+
ions = {'mass': 40, 'charge': 1}
|
|
62
|
+
|
|
63
|
+
#placing ion in random cloud near minimum
|
|
64
|
+
positions = sn.ioncloud_min(x0, ion_number, 10e-6)
|
|
65
|
+
s.append(pl.placeions(ions, positions))
|
|
66
|
+
|
|
67
|
+
#declaration of a five wire trap
|
|
68
|
+
s.append(sn.polygon_trap([Omega, Omega], [Vrf, Vrf], dc_set, RF_electrodes, DC_electrodes))
|
|
69
|
+
|
|
70
|
+
#cooling simulation
|
|
71
|
+
s.append(pl.langevinbath(0, 1e-7))
|
|
72
|
+
|
|
73
|
+
#files with simulation information
|
|
74
|
+
s.append(pl.dump('positions.txt', variables=['x', 'y', 'z'], steps=10))
|
|
75
|
+
s.append(pl.evolve(1e5))
|
|
76
|
+
try:
|
|
77
|
+
s.execute()
|
|
78
|
+
pass
|
|
79
|
+
except:
|
|
80
|
+
pass
|
|
81
|
+
|
|
82
|
+
_, data = pl.readdump('positions.txt')
|
|
83
|
+
data *= 1e6
|
|
84
|
+
|
|
85
|
+
final_x = data[-1, :, 0]
|
|
86
|
+
final_y = data[-1, :, 1]
|
|
87
|
+
final_z = data[-1, :, 2]
|
|
88
|
+
|
|
89
|
+
ion_positions = np.zeros([ion_number, 3])
|
|
90
|
+
sort = np.argsort(final_x)
|
|
91
|
+
|
|
92
|
+
equilibrium_positions = []
|
|
93
|
+
for i in range(ion_number):
|
|
94
|
+
equilibrium_positions.append(L*np.array([np.mean(data[9000:, i, 0]), np.mean(data[9000:, i, 1]), np.mean(data[9000:, i, 2])]))
|
|
95
|
+
equilibrium_positions = np.array(equilibrium_positions)
|
|
96
|
+
|
|
97
|
+
k=0
|
|
98
|
+
for i in sort:
|
|
99
|
+
ion_positions[k] = np.array([equilibrium_positions[i][0], equilibrium_positions[i][1], equilibrium_positions[i][2]])
|
|
100
|
+
k+=1
|
|
101
|
+
|
|
102
|
+
np.set_printoptions(2)
|
|
103
|
+
print('Final positions of ions in um:\n', ion_positions)
|
|
104
|
+
|
|
105
|
+
"""Normal modes"""
|
|
106
|
+
|
|
107
|
+
freqs, modes = sn.normal_modes(ion_positions, omega_sec, mass, linear = True)
|
|
108
|
+
axial_freqs = freqs[0]
|
|
109
|
+
axial_modes = modes[0]
|
|
110
|
+
np.set_printoptions(0)
|
|
111
|
+
|
|
112
|
+
print('Axial mode frequencies:', axial_freqs, 'Hz')
|
|
113
|
+
|
|
114
|
+
np.set_printoptions(4)
|
|
115
|
+
print('Axial modes:', axial_modes)
|
|
116
|
+
|
|
117
|
+
theor_modes = -1*np.array([[0.4472,0.4472,0.4472,0.4472,0.4472],[0.6395,0.3017, 0, -0.3017, -0.6395],
|
|
118
|
+
[0.5377, -0.2805, -0.5143,-0.2805, 0.5377], [-0.3017,0.6395,0,-0.6395,0.3017],
|
|
119
|
+
[0.1045,-0.4704,0.7318,-0.4704, 0.1045]])
|
|
120
|
+
theor_freqs = np.array([1,3,5.818,9.332,13.47])
|
|
121
|
+
freqs = np.sqrt(theor_freqs)*omega_sec[0]
|
|
122
|
+
print('Verification process.')
|
|
123
|
+
|
|
124
|
+
l2 = (ct.e**2 / (4 * np.pi * ct.epsilon_0 * 40 * ct.atomic_mass * (omega_sec[0] * 2 * np.pi) ** 2)) ** (1/3)
|
|
125
|
+
theor_positions = np.array([-1.7429, -0.8221, 0, 0.8221, 1.7429]) * l2
|
|
126
|
+
pos_diff = np.linalg.norm(theor_positions - final_x[sort]*1e-6)
|
|
127
|
+
|
|
128
|
+
print('Difference from theoretical positions:', np.round(pos_diff * 1e6, 4), 'um')
|
|
129
|
+
|
|
130
|
+
print('Difference from theoretical frequencies:', np.round(np.abs(freqs-axial_freqs),1), 'Hz')
|
|
131
|
+
|
|
132
|
+
diff = np.zeros(5)
|
|
133
|
+
for i in range(5):
|
|
134
|
+
dif = axial_modes - theor_modes
|
|
135
|
+
diff[i] = np.linalg.norm(dif[i])
|
|
136
|
+
if diff[i] > 1:
|
|
137
|
+
dif = axial_modes + theor_modes
|
|
138
|
+
diff[i] = np.linalg.norm(dif[i])
|
|
139
|
+
print('Difference in mode vectors', diff)
|
|
140
|
+
|
|
141
|
+
# Plot of ion crystal evolution
|
|
142
|
+
plt.figure()
|
|
143
|
+
for n in range(ion_number):
|
|
144
|
+
plt.plot(np.arange(data.shape[0]) * 10 + 1, data[:, n, 0])
|
|
145
|
+
plt.title('Evolution of ion\'s x coordinates')
|
|
146
|
+
plt.xlabel('Time step')
|
|
147
|
+
plt.ylabel('Ion\'s x coordinates')
|
|
148
|
+
plt.show()
|
|
149
|
+
|
|
150
|
+
# Plot of the final ion crystal configuration
|
|
151
|
+
plt.figure()
|
|
152
|
+
plt.scatter(data[-1, :, 0], data[-1, :, 1])
|
|
153
|
+
plt.title('Ion\'s equilibrium positions')
|
|
154
|
+
plt.xlabel('Ion\'s x coordinates')
|
|
155
|
+
plt.ylabel('Ion\'s y coordinates')
|
|
156
|
+
plt.ylim([80, 120])
|
|
157
|
+
plt.show()
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"""
|
|
2
|
+
In this example we model single ion in the RF ring electrode.
|
|
3
|
+
The parameters are chosen, so theoretically the position of minimum (and single ion)
|
|
4
|
+
will be at the point (0,0, 100) mkm.
|
|
5
|
+
The increase in accuracy, followed with the increse in the resolution, leads to
|
|
6
|
+
the increase time, required for the simulation.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
from __future__ import division
|
|
11
|
+
import pylion as pl
|
|
12
|
+
from pathlib import Path
|
|
13
|
+
import matplotlib as mpl
|
|
14
|
+
import matplotlib.pyplot as plt, numpy as np, scipy.constants as ct
|
|
15
|
+
from mpl_toolkits.mplot3d import Axes3D
|
|
16
|
+
from electrode import (System, PolygonPixelElectrode, PointPixelElectrode)
|
|
17
|
+
|
|
18
|
+
import sion as sn
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
if __name__ == "__main__":
|
|
22
|
+
#trap parameters
|
|
23
|
+
Vrf = 120. # RF peak voltage in V
|
|
24
|
+
mass = 40 * ct.atomic_mass # ion mass
|
|
25
|
+
Z = 1 * ct.elementary_charge # ion charge
|
|
26
|
+
Omega = 2 * np.pi * 30e6 # RF frequency in rad/s
|
|
27
|
+
Urf = Vrf*np.sqrt(Z/mass)/(2*Omega)
|
|
28
|
+
|
|
29
|
+
#theoretically obtained radiuses of the ring for ion's height to be 100 mkm
|
|
30
|
+
sc = np.sqrt(3/(4*np.sin(np.pi/12)**2)-1)
|
|
31
|
+
r = 100/np.sqrt(2)*1e-6
|
|
32
|
+
R = 100*sc*1e-6
|
|
33
|
+
res = 50
|
|
34
|
+
dif = 0
|
|
35
|
+
Nring = 1
|
|
36
|
+
scale = 1.5*R
|
|
37
|
+
|
|
38
|
+
def boundaries(i, x):
|
|
39
|
+
if i == 0:
|
|
40
|
+
if (x[0]**2+x[1]**2 > r**2) and (x[0]**2+x[1]**2 < R**2):
|
|
41
|
+
return True
|
|
42
|
+
else:
|
|
43
|
+
return False
|
|
44
|
+
|
|
45
|
+
s, trap = sn.point_trap_design(frequencies = [Omega], rf_voltages = [Vrf], dc_voltages = [], boundaries = boundaries, scale = scale, resolution = res, need_plot = True, need_coordinates = True)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
#placing 1 ion
|
|
49
|
+
ion_number = 1
|
|
50
|
+
distance = 0
|
|
51
|
+
positions = sn.ions_in_order([0,0,95e-6], ion_number, distance)
|
|
52
|
+
|
|
53
|
+
#insert your path to this file here
|
|
54
|
+
name = Path('RingSimulation.py').stem
|
|
55
|
+
|
|
56
|
+
sim = pl.Simulation(name)
|
|
57
|
+
|
|
58
|
+
#ion's declaration
|
|
59
|
+
ions = {'mass': 40, 'charge': 1}
|
|
60
|
+
|
|
61
|
+
sim.append(pl.placeions(ions, positions))
|
|
62
|
+
|
|
63
|
+
#ring trap initialization
|
|
64
|
+
sim.append(sn.point_trap(trap))
|
|
65
|
+
|
|
66
|
+
#cooling simulation
|
|
67
|
+
sim.append(pl.langevinbath(0, 1e-7))
|
|
68
|
+
|
|
69
|
+
#files with information
|
|
70
|
+
sim.append(pl.dump('posring.txt', variables=['x', 'y', 'z'], steps=10))
|
|
71
|
+
sim.append(pl.evolve(1e4))
|
|
72
|
+
#sim.execute()
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
_, data = pl.readdump('posring.txt')
|
|
76
|
+
data *= 1e6
|
|
77
|
+
|
|
78
|
+
final_x = data[-1, :, 0]
|
|
79
|
+
final_y = data[-1, :, 1]
|
|
80
|
+
final_z = data[-1, :, 2]
|
|
81
|
+
|
|
82
|
+
print('Initial ion position:\n', [0, 0, 95])
|
|
83
|
+
print('Final ion position:\n', np.round([final_x[0], final_y[0], final_z[0]]), 'um')
|
|
84
|
+
print('Distance from theoretical position:', np.round(np.linalg.norm(np.array([final_x[0], final_y[0], final_z[0]]) - np.array([0, 0, 100])), 3), 'um')
|
|
85
|
+
|
|
86
|
+
plt.figure()
|
|
87
|
+
for n in range(ion_number):
|
|
88
|
+
plt.plot(np.arange(data.shape[0]) * 10 + 1, data[:, n, 2])
|
|
89
|
+
plt.title('Evolution of ion\'s z coordinates')
|
|
90
|
+
plt.xlabel('Time step')
|
|
91
|
+
plt.ylabel('z, um')
|
|
92
|
+
plt.show()
|