create solvers and interface modules
Co-authored-by: Johanna Zijderveld
Merge request reports
Activity
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) mentioned in commit 6f281e4f
mentioned in merge request !4 (merged)