Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
mbtrack2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PA
Collective Effects
mbtrack2
Commits
bb41cdf8
Commit
bb41cdf8
authored
4 months ago
by
Alexis GAMELIN
Browse files
Options
Downloads
Plain Diff
Merge branch 'turn-off-qexec' into 'develop'
Turn off quantum excitation See merge request
!20
parents
e792f648
ad30d3bd
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!28
0.8.0
,
!20
Turn off quantum excitation
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mbtrack2/tracking/element.py
+41
-17
41 additions, 17 deletions
mbtrack2/tracking/element.py
with
41 additions
and
17 deletions
mbtrack2/tracking/element.py
+
41
−
17
View file @
bb41cdf8
...
...
@@ -144,12 +144,22 @@ class SynchrotronRadiation(Element):
----------
ring : Synchrotron object
switch : bool array of shape (3,), optional
allow to choose on which plane the synchrotron radiation is active
If False in one plane (long, x, y), the synchrotron radiation is turned
off.
The default is True, in all three planes.
qexcitation : bool, optional
If False, the quantum excitation is turned off.
The default is True.
"""
def
__init__
(
self
,
ring
,
switch
=
np
.
ones
((
3
,
),
dtype
=
bool
)):
def
__init__
(
self
,
ring
,
switch
=
np
.
ones
((
3
,
),
dtype
=
bool
),
qexcitation
=
True
):
self
.
ring
=
ring
self
.
switch
=
switch
self
.
qexcitation
=
qexcitation
@Element.parallel
def
track
(
self
,
bunch
):
...
...
@@ -163,23 +173,37 @@ class SynchrotronRadiation(Element):
bunch : Bunch or Beam object
"""
N
=
len
(
bunch
)
if
self
.
switch
[
0
]
==
True
:
rand
=
np
.
random
.
standard_normal
(
size
=
N
)
bunch
[
"
delta
"
]
=
(
1
-
2
*
self
.
ring
.
T0
/
self
.
ring
.
tau
[
2
])
*
bunch
[
"
delta
"
]
+
2
*
self
.
ring
.
sigma_delta
*
(
excitation
=
0
if
self
.
switch
[
0
]:
if
self
.
qexcitation
:
rand
=
np
.
random
.
standard_normal
(
size
=
N
)
excitation
=
2
*
self
.
ring
.
sigma_delta
*
(
self
.
ring
.
T0
/
self
.
ring
.
tau
[
2
])
**
0.5
*
rand
if
self
.
switch
[
1
]
==
True
:
rand
=
np
.
random
.
standard_normal
(
size
=
N
)
bunch
[
"
xp
"
]
=
(
1
-
2
*
self
.
ring
.
T0
/
self
.
ring
.
tau
[
0
]
)
*
bunch
[
"
xp
"
]
+
2
*
self
.
ring
.
sigma
()[
1
]
*
(
self
.
ring
.
T0
/
self
.
ring
.
tau
[
0
])
**
0.5
*
rand
if
self
.
switch
[
2
]
==
True
:
rand
=
np
.
random
.
standard_normal
(
size
=
N
)
bunch
[
"
yp
"
]
=
(
1
-
2
*
self
.
ring
.
T0
/
self
.
ring
.
tau
[
1
]
)
*
bunch
[
"
yp
"
]
+
2
*
self
.
ring
.
sigma
()[
3
]
*
(
self
.
ring
.
T0
/
self
.
ring
.
tau
[
1
])
**
0.5
*
rand
bunch
[
"
delta
"
]
=
(
1
-
2
*
self
.
ring
.
T0
/
self
.
ring
.
tau
[
2
])
*
bunch
[
"
delta
"
]
+
excitation
if
self
.
switch
[
1
]:
if
self
.
qexcitation
:
rand
=
np
.
random
.
standard_normal
(
size
=
N
)
excitation
=
2
*
self
.
ring
.
sigma
()[
1
]
*
(
self
.
ring
.
T0
/
self
.
ring
.
tau
[
0
])
**
0.5
*
rand
bunch
[
"
xp
"
]
=
(
1
-
2
*
self
.
ring
.
T0
/
self
.
ring
.
tau
[
0
])
*
bunch
[
"
xp
"
]
+
excitation
if
self
.
switch
[
2
]:
if
self
.
qexcitation
:
rand
=
np
.
random
.
standard_normal
(
size
=
N
)
excitation
=
2
*
self
.
ring
.
sigma
()[
3
]
*
(
self
.
ring
.
T0
/
self
.
ring
.
tau
[
1
])
**
0.5
*
rand
bunch
[
"
yp
"
]
=
(
1
-
2
*
self
.
ring
.
T0
/
self
.
ring
.
tau
[
1
])
*
bunch
[
"
yp
"
]
+
excitation
class
SkewQuadrupole
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment