Skip to content
Snippets Groups Projects

create solvers and interface modules

Merged Anton Akhmerov requested to merge interface-refactoring into main
3 unresolved threads

Co-authored-by: Johanna Zijderveld

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • As summary from an online discussion, we have identified several things to try:

    Applying the code

    To see whether the library design makes sense, we should use it in different scenarios.

    • One is the application of it to the graphene project.
    • Another one, which can go into the demo notebooks, is plotting the free energy as a function of the mean field amplitude and confirming that the converged result is actually the minimum.

    Short range interactions

    I believe that the code right now doesn't exploit the interaction being short range (when it actually is short range). It seems that the k-space tensor contraction can be made into a smaller one by Fourier transforming the density matrix and doing the contraction in real space.

    This is also a possible source of the lack of convergence of the minimizers.

    Separation between mean field parameters and interaction range

    Right now the fixed point algorithm requires that the mean field correction has the same range as the interaction, which is technically always the case. However, in many physical scenarios one may want to consider a long-range interaction, e.g. Coulomb, and only a short range symmetry breaking. I therefore propose to separate mean field correction generation from the matrix structure.

    As a concrete example I propose to consider 1D model with Coulomb repulsion, and an onsite antiferromagnetic order parameter. Then I propose to define the free energy as a a k-space convolution and solve a 1D minimization problem for it. This will confirm that the code is usable for constrained problems and allows us to verify whether the concepts are clearly separated in the interface.

codes/solvers.py 0 → 100644
36 optimize(initial_mf, partial_cost, optimizer, optimizer_kwargs)
37
38 def real_space_cost(mf, model, shape):
39 mf = utils.flat_to_matrix(utils.real_to_complex(mf), shape)
40 mf_dict = {}
41 for i, key in enumerate(model.guess.keys()):
42 mf_dict[key] = mf[i]
43 mf = utils.kgrid_hamiltonian(
44 nk=model.nk,
45 hk=utils.model2hk(mf_dict),
46 dim=model.dim,
47 hermitian=False
48 )
49 model.rho, model.mf_k = updated_matrices(mf_k=mf, model=model)
50 delta_mf = model.mf_k - mf
51 delta_mf = utils.hk2tb_model(delta_mf, model.vectors, model.ks)
  • 96 96 row, col = np.array([*product(row, col)]).T
    97 97 try:
    98 98 for arg in inspect.getfullargspec(val).args:
    99 99 _params = {}
  • 68 68 row, col = np.array([*product(row, col)]).T
    69 69 try:
    70 70 for arg in inspect.getfullargspec(val).args:
    71 71 _params = {}
  • Kostas Vilkelis added 4 commits

    added 4 commits

    • a5ddef60 - remove dim from function arguments
    • 1a3f357d - remove from redundant args
    • 17a7647d - normalize total energy to kpoint number
    • 4ed37a68 - push total energy check

    Compare with previous version

  • Antonio Manesco added 1 commit

    added 1 commit

    Compare with previous version

  • Antonio Manesco added 2 commits

    added 2 commits

    Compare with previous version

  • Antonio Manesco added 1 commit

    added 1 commit

    Compare with previous version

  • Antonio Manesco added 1 commit

    added 1 commit

    Compare with previous version

  • Antonio Manesco added 5 commits

    added 5 commits

    Compare with previous version

  • Kostas Vilkelis mentioned in commit 6f281e4f

    mentioned in commit 6f281e4f

  • Kostas Vilkelis mentioned in merge request !4 (merged)

    mentioned in merge request !4 (merged)

  • Please register or sign in to reply
    Loading