Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
MeanFi
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Quantum Tinkerer
MeanFi
Commits
d978b6ae
Commit
d978b6ae
authored
May 6, 2024
by
Kostas Vilkelis
Committed by
Johanna Zijderveld
May 7, 2024
Browse files
Options
Downloads
Patches
Plain Diff
use ndof instead of shape
parent
3b111043
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!7
Examples
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
pymf/params/param_transforms.py
+4
-4
4 additions, 4 deletions
pymf/params/param_transforms.py
pymf/params/rparams.py
+1
-1
1 addition, 1 deletion
pymf/params/rparams.py
with
5 additions
and
5 deletions
pymf/params/param_transforms.py
+
4
−
4
View file @
d978b6ae
...
...
@@ -27,7 +27,7 @@ def tb_to_flat(tb: tb_type) -> np.ndarray:
def
flat_to_tb
(
tb_param_complex
:
np
.
ndarray
,
shape
:
tuple
[
int
,
int
]
,
ndof
:
int
,
tb_keys
:
list
[
tuple
[
None
]
|
tuple
[
int
,
...]],
)
->
tb_type
:
"""
Reverse operation to `tb_to_flat`.
...
...
@@ -38,9 +38,8 @@ def flat_to_tb(
----------
tb_param_complex :
1d complex array that parametrises the tb model.
shape :
Tuple (n, n) where n is the number of internal degrees of freedom
(e.g. orbitals, spin, sublattice) within the tight-binding model.
ndof :
Number internal degrees of freedom within the unit cell.
tb_keys :
List of keys of the tight-binding dictionary.
...
...
@@ -49,6 +48,7 @@ def flat_to_tb(
tb :
tight-binding dictionary
"""
shape
=
(
len
(
tb_keys
),
ndof
,
ndof
)
if
len
(
tb_keys
[
0
])
==
0
:
matrix
=
np
.
zeros
((
shape
[
-
1
],
shape
[
-
2
]),
dtype
=
complex
)
matrix
[
np
.
triu_indices
(
shape
[
-
1
])]
=
tb_param_complex
...
...
This diff is collapsed.
Click to expand it.
pymf/params/rparams.py
+
1
−
1
View file @
d978b6ae
...
...
@@ -45,4 +45,4 @@ def rparams_to_tb(
Tight-biding dictionary.
"""
flat_matrix
=
real_to_complex
(
tb_params
)
return
flat_to_tb
(
flat_matrix
,
(
len
(
tb_keys
),
ndof
,
ndof
)
,
tb_keys
)
return
flat_to_tb
(
flat_matrix
,
ndof
,
tb_keys
)
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