Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Scientific Software
mmtk
Commits
7d782196
Commit
7d782196
authored
Dec 12, 2017
by
eric pellegrini
Browse files
removed Scientific.LA deps
Updated code accordingly (eigen vectors tranpose)
parent
3861251b
Changes
3
Hide whitespace changes
Inline
Side-by-side
MMTK/Collections.py
View file @
7d782196
...
@@ -320,10 +320,10 @@ class GroupOfAtoms(object):
...
@@ -320,10 +320,10 @@ class GroupOfAtoms(object):
:returns: the normalizing transformation
:returns: the normalizing transformation
:rtype: Scientific.Geometry.Transformation.RigidBodyTransformation
:rtype: Scientific.Geometry.Transformation.RigidBodyTransformation
"""
"""
from
Scientific.LA
import
det
erminant
from
numpy.linalg.linalg
import
det
cm
,
inertia
=
self
.
centerAndMomentOfInertia
()
cm
,
inertia
=
self
.
centerAndMomentOfInertia
()
ev
,
diag
=
inertia
.
diagonalization
()
ev
,
diag
=
inertia
.
diagonalization
()
if
det
erminant
(
diag
.
array
)
<
0
:
if
det
(
diag
.
array
)
<
0
:
diag
.
array
[
0
]
=
-
diag
.
array
[
0
]
diag
.
array
[
0
]
=
-
diag
.
array
[
0
]
if
repr
!=
None
:
if
repr
!=
None
:
seq
=
numpy
.
argsort
(
ev
)
seq
=
numpy
.
argsort
(
ev
)
...
...
MMTK/NormalModes/Core.py
View file @
7d782196
...
@@ -42,7 +42,7 @@ if dgesdd is None:
...
@@ -42,7 +42,7 @@ if dgesdd is None:
from
lapack_dge
import
dgesdd
from
lapack_dge
import
dgesdd
except
ImportError
:
pass
except
ImportError
:
pass
if
dsyevd
is
None
:
if
dsyevd
is
None
:
from
Scientific.LA
import
H
eig
envectors
from
numpy.linalg
import
eig
h
if
dsyevd
:
if
dsyevd
:
n
=
1
n
=
1
array
=
numpy
.
zeros
((
n
,
n
),
numpy
.
float
)
array
=
numpy
.
zeros
((
n
,
n
),
numpy
.
float
)
...
@@ -259,7 +259,7 @@ class NormalModes(object):
...
@@ -259,7 +259,7 @@ class NormalModes(object):
ev
,
modes
=
Heigenvectors
(
self
.
array
)
ev
,
modes
=
Heigenvectors
(
self
.
array
)
ev
=
ev
.
real
ev
=
ev
.
real
modes
=
modes
.
real
modes
=
modes
.
real
self
.
array
=
modes
self
.
array
=
modes
.
T
else
:
else
:
ev
=
numpy
.
zeros
((
self
.
nmodes
,),
numpy
.
float
)
ev
=
numpy
.
zeros
((
self
.
nmodes
,),
numpy
.
float
)
work
=
numpy
.
zeros
((
1
,),
numpy
.
float
)
work
=
numpy
.
zeros
((
1
,),
numpy
.
float
)
...
...
MMTK/Trajectory.py
View file @
7d782196
...
@@ -935,9 +935,10 @@ class RigidBodyTrajectory(object):
...
@@ -935,9 +935,10 @@ class RigidBodyTrajectory(object):
quaternions
=
numpy
.
zeros
((
steps
,
4
),
numpy
.
float
)
quaternions
=
numpy
.
zeros
((
steps
,
4
),
numpy
.
float
)
fit
=
numpy
.
zeros
((
steps
,),
numpy
.
float
)
fit
=
numpy
.
zeros
((
steps
,),
numpy
.
float
)
from
Scientific.LA
import
eig
envectors
from
numpy.linalg
import
eig
for
i
in
range
(
steps
):
for
i
in
range
(
steps
):
e
,
v
=
eigenvectors
(
k
[
i
])
e
,
v
=
eig
(
k
[
i
])
v
=
v
.
T
j
=
numpy
.
argmin
(
e
)
j
=
numpy
.
argmin
(
e
)
if
e
[
j
]
<
0.
:
if
e
[
j
]
<
0.
:
fit
[
i
]
=
0.
fit
[
i
]
=
0.
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment