Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
torchani
Commits
3af8c49e
Commit
3af8c49e
authored
Nov 07, 2019
by
Gao, Xiang
Committed by
Farhad Ramezanghorbani
Nov 07, 2019
Browse files
Use @ syntax (#371)
parent
ffb075e6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
torchani/aev.py
torchani/aev.py
+2
-2
No files found.
torchani/aev.py
View file @
3af8c49e
...
@@ -149,7 +149,7 @@ def neighbor_pairs(padding_mask, coordinates, cell, shifts, cutoff):
...
@@ -149,7 +149,7 @@ def neighbor_pairs(padding_mask, coordinates, cell, shifts, cutoff):
shifts_all
=
torch
.
cat
([
shifts_center
,
shifts_outide
])
shifts_all
=
torch
.
cat
([
shifts_center
,
shifts_outide
])
p1_all
=
torch
.
cat
([
p1_center
,
p1
])
p1_all
=
torch
.
cat
([
p1_center
,
p1
])
p2_all
=
torch
.
cat
([
p2_center
,
p2
])
p2_all
=
torch
.
cat
([
p2_center
,
p2
])
shift_values
=
torch
.
mm
(
shifts_all
.
to
(
cell
.
dtype
)
,
cell
)
shift_values
=
shifts_all
.
to
(
cell
.
dtype
)
@
cell
# step 5, compute distances, and find all pairs within cutoff
# step 5, compute distances, and find all pairs within cutoff
distances
=
(
coordinates
.
index_select
(
1
,
p1_all
)
-
coordinates
.
index_select
(
1
,
p2_all
)
+
shift_values
).
norm
(
2
,
-
1
)
distances
=
(
coordinates
.
index_select
(
1
,
p1_all
)
-
coordinates
.
index_select
(
1
,
p2_all
)
+
shift_values
).
norm
(
2
,
-
1
)
...
@@ -241,7 +241,7 @@ def compute_aev(species, coordinates, cell, shifts, triu_index, constants, sizes
...
@@ -241,7 +241,7 @@ def compute_aev(species, coordinates, cell, shifts, triu_index, constants, sizes
coordinates
=
coordinates
.
flatten
(
0
,
1
)
coordinates
=
coordinates
.
flatten
(
0
,
1
)
species1
=
species
[
atom_index1
]
species1
=
species
[
atom_index1
]
species2
=
species
[
atom_index2
]
species2
=
species
[
atom_index2
]
shift_values
=
torch
.
mm
(
shifts
.
to
(
cell
.
dtype
)
,
cell
)
shift_values
=
shifts
.
to
(
cell
.
dtype
)
@
cell
vec
=
coordinates
.
index_select
(
0
,
atom_index1
)
-
coordinates
.
index_select
(
0
,
atom_index2
)
+
shift_values
vec
=
coordinates
.
index_select
(
0
,
atom_index1
)
-
coordinates
.
index_select
(
0
,
atom_index2
)
+
shift_values
distances
=
vec
.
norm
(
2
,
-
1
)
distances
=
vec
.
norm
(
2
,
-
1
)
...
...
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