Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Scientific Software
Takin
mag-core
Commits
bf0be92f
Verified
Commit
bf0be92f
authored
Apr 13, 2021
by
Tobias WEBER
Browse files
small simplification
parent
a6af5ee8
Changes
1
Show whitespace changes
Inline
Side-by-side
tools/tascalc/tas.py
View file @
bf0be92f
...
...
@@ -92,7 +92,7 @@ if use_scipy:
hbar_in_meVs
=
co
.
Planck
/
co
.
elementary_charge
*
1000.
/
2.
/
np
.
pi
E_to_k2
=
2.
*
co
.
neutron_mass
/
hbar_in_meVs
**
2.
/
co
.
elementary_charge
*
1000.
*
1e-20
else
:
E_to_k2
=
0.4825964
0646
4
# calculated with scipy, using the formula above
E_to_k2
=
0.4825964
2354
4
# calculated with scipy, using the formula above
k2_to_E
=
1.
/
E_to_k2
# -----------------------------------------------------------------------------
...
...
@@ -139,13 +139,14 @@ def get_psi(ki, kf, Q, sense=1.):
# see https://de.wikipedia.org/wiki/Fraktionelle_Koordinaten
def
get_A
(
lattice
,
angles
):
cs
=
np
.
cos
(
angles
)
s1
=
np
.
sin
(
angles
[
1
])
s2
=
np
.
sin
(
angles
[
2
])
a
=
lattice
[
0
]
*
np
.
array
([
1
,
0
,
0
])
b
=
lattice
[
1
]
*
np
.
array
([
cs
[
2
],
s2
,
0
])
c
=
lattice
[
2
]
*
np
.
array
([
cs
[
1
],
\
(
cs
[
0
]
-
cs
[
1
]
*
cs
[
2
])
/
s2
,
\
(
np
.
sqrt
(
1.
-
np
.
dot
(
cs
,
cs
)
+
2.
*
cs
[
0
]
*
cs
[
1
]
*
cs
[
2
])
)
/
s2
])
np
.
sqrt
(
s1
*
s1
-
((
cs
[
0
]
-
cs
[
2
]
*
cs
[
1
])
/
s2
)
**
2.
)
])
# the real-space basis vectors form the columns of the A matrix
return
np
.
transpose
(
np
.
array
([
a
,
b
,
c
]))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment