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
Merge requests
!4
Interface refactoring
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Interface refactoring
interface-refactoring
into
main
Overview
66
Commits
140
Pipelines
46
Changes
1
Merged
Kostas Vilkelis
requested to merge
interface-refactoring
into
main
1 year ago
Overview
5
Commits
140
Pipelines
46
Changes
1
Expand
Find a design which is more intuitive and minimal.
0
0
Merge request reports
Viewing commit
8e5b7d74
Show latest version
1 file
+
59
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
8e5b7d74
example nb of current interface
· 8e5b7d74
Kostas Vilkelis
authored
1 year ago
examples/testInterface.ipynb
0 → 100644
+
59
−
0
Options
%% Cell type:code id: tags:
```
python
import
numpy
as
np
from
codes
import
utils
,
model
,
solvers
```
%% Cell type:code id: tags:
```
python
def
random_guess
(
vectors
,
int_model
):
"""
Generate random guess.
Parameters:
-----------
vectors : list of tuples
Hopping vectors for the mean-field corrections.
"""
scale
=
0.1
*
(
1
+
np
.
max
(
np
.
abs
([
*
int_model
.
values
()])))
return
utils
.
generate_guess
(
vectors
=
vectors
,
ndof
=
len
([
*
int_model
.
values
()][
0
]),
scale
=
scale
)
```
%% Cell type:code id: tags:
```
python
U0
=
1
nk
=
100
filling
=
2
hopp
=
np
.
kron
(
np
.
array
([[
0
,
1
],
[
0
,
0
]]),
np
.
eye
(
2
))
tb_model
=
{(
0
,):
hopp
+
hopp
.
T
.
conj
(),
(
1
,):
hopp
,
(
-
1
,):
hopp
.
T
.
conj
()}
int_model
=
{
(
0
,):
U0
*
np
.
kron
(
np
.
eye
(
2
),
np
.
ones
((
2
,
2
))),
}
testModel
=
model
.
MfModel
(
tb_model
,
int_model
,
filling
)
guess
=
utils
.
tb2grid
(
random_guess
(
tb_model
.
keys
(),
int_model
),
nk
)
solvers
.
kspace_solver
(
testModel
,
guess
)
```
%% Output
array([ 4.81536544e-01, 6.41071801e-03, -1.76048506e-07, ...,
0.00000000e+00, 1.33679796e-06, 0.00000000e+00])
%% Cell type:code id: tags:
```
python
``
`
%%
Cell
type
:
code
id
:
tags
:
```
python
```
Loading