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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Quantum Tinkerer
MeanFi
Commits
a7520f38
Commit
a7520f38
authored
11 months ago
by
Johanna Zijderveld
Browse files
Options
Downloads
Patches
Plain Diff
another tiny rename
parent
e76da563
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!4
Interface refactoring
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
codes/params/matrixShaping.py
+3
-3
3 additions, 3 deletions
codes/params/matrixShaping.py
codes/params/rparams.py
+4
-4
4 additions, 4 deletions
codes/params/rparams.py
with
7 additions
and
7 deletions
codes/params/matrixShaping.py
+
3
−
3
View file @
a7520f38
import
numpy
as
np
def
hop_dic
t_to_flat
(
hop_dict
):
def
t
b
_to_flat
(
hop_dict
):
"""
Convert a hermitian tight-binding dictionary to flat complex matrix.
...
...
@@ -22,9 +22,9 @@ def hop_dict_to_flat(hop_dict):
return
sorted_vals
[:
N
].
flatten
()
def
flat_to_
hop_dic
t
(
flat
,
shape
,
hop_dict_keys
):
def
flat_to_t
b
(
flat
,
shape
,
hop_dict_keys
):
"""
Reverse operation to `
hop_dic
t_to_flat` that takes a flat complex 1d array
Reverse operation to `t
b
_to_flat` that takes a flat complex 1d array
and return the tight-binding dictionary.
Parameters:
...
...
This diff is collapsed.
Click to expand it.
codes/params/rparams.py
+
4
−
4
View file @
a7520f38
from
codes.params.matrixShaping
import
(
complex_to_real
,
hop_dic
t_to_flat
,
t
b
_to_flat
,
real_to_complex
,
flat_to_
hop_dic
t
,
flat_to_t
b
,
)
...
...
@@ -20,7 +20,7 @@ def mf_to_rparams(mf_model):
dict
Real parameters.
"""
return
complex_to_real
(
hop_dic
t_to_flat
(
mf_model
))
# placeholder for now
return
complex_to_real
(
t
b
_to_flat
(
mf_model
))
# placeholder for now
def
rparams_to_mf
(
rParams
,
key_list
,
size
):
...
...
@@ -41,4 +41,4 @@ def rparams_to_mf(rParams, key_list, size):
"""
flat_matrix
=
real_to_complex
(
rParams
)
return
flat_to_
hop_dic
t
(
flat_matrix
,
(
len
(
key_list
),
size
,
size
),
key_list
)
return
flat_to_t
b
(
flat_matrix
,
(
len
(
key_list
),
size
,
size
),
key_list
)
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