Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gext
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Michele Nottoli
gext
Commits
b0034d8b
Commit
b0034d8b
authored
1 year ago
by
Michele Nottoli
Browse files
Options
Downloads
Patches
Plain Diff
Update.
parent
76adbf0a
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
grext/main.py
+7
-3
7 additions, 3 deletions
grext/main.py
with
7 additions
and
3 deletions
grext/main.py
+
7
−
3
View file @
b0034d8b
...
...
@@ -4,13 +4,16 @@ from typing import Optional
import
numpy
as
np
from
.
import
grassmann
from
.
import
fitting
from
.buffer
import
CircularBuffer
class
Extrapolator
:
"""
Class for performing Grassmann extrapolations. On initialization
it requires the number of electrons, the number of basis functions
and the number of atoms of the molecule.
"""
and the number of atoms of the molecule. The number of previous
steps used by the extrapolator is an optional argument with default
value of 10.
"""
def
__init__
(
self
,
nelectrons
:
int
,
nbasis
:
int
,
natoms
:
int
,
nsteps
:
int
=
10
):
...
...
@@ -41,6 +44,7 @@ class Extrapolator:
def
guess
(
self
,
coords
:
np
.
ndarray
,
overlap
:
Optional
[
np
.
ndarray
]):
"""
Get a new electronic density to be used as a guess.
"""
coefficients
=
fitting
.
linear
()
def
_crop_coeff
(
self
,
coeff
)
->
np
.
ndarray
:
"""
Crop the coefficient matrix to remove the virtual orbitals.
"""
...
...
@@ -56,13 +60,13 @@ class Extrapolator:
"""
Set the tangent point.
"""
self
.
tangent
=
c
def
_grassmann_log
(
self
,
coeff
:
np
.
ndarray
):
def
_grassmann_log
(
self
,
coeff
:
np
.
ndarray
)
->
np
.
ndarray
:
"""
Map from the manifold to the tangent plane.
"""
if
self
.
tangent
is
not
None
:
return
grassmann
.
log
(
coeff
,
self
.
tangent
)
raise
ValueError
(
"
Tangent point is not set.
"
)
def
_grassmann_exp
(
self
,
gamma
:
np
.
ndarray
):
def
_grassmann_exp
(
self
,
gamma
:
np
.
ndarray
)
->
np
.
ndarray
:
"""
Map from the tangent plane to the manifold.
"""
if
self
.
tangent
is
not
None
:
return
grassmann
.
exp
(
gamma
,
self
.
tangent
)
...
...
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