From a5ddef60ff3059c0afd63b3e5aba0fdb9e6b1fbf Mon Sep 17 00:00:00 2001
From: Kostas Vilkelis <kostasvilkelis@gmail.com>
Date: Fri, 19 Jan 2024 12:57:21 +0100
Subject: [PATCH] remove dim from function arguments

---
 codes/hf.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/codes/hf.py b/codes/hf.py
index af103d3..3f92b15 100644
--- a/codes/hf.py
+++ b/codes/hf.py
@@ -78,7 +78,7 @@ def convolution(M1, M2):
     return V_output
 
 
-def compute_mf(rho, H_int, dim):
+def compute_mf(rho, H_int):
     """
     Compute mean-field correction at self-consistent loop.
 
@@ -96,6 +96,7 @@ def compute_mf(rho, H_int, dim):
     """
     
     nk = rho.shape[0]
+    dim = len(rho.shape) - 2
     
     if dim > 0:
         H0_int = H_int[*([0]*dim)]
@@ -154,6 +155,5 @@ def updated_matrices(mf_k, model):
     rho = density_matrix(vals=vals, vecs=vecs, E_F=E_F, dim=model.dim)
     return rho, compute_mf(
         rho=rho,
-        H_int=model.H_int,
-        dim=model.dim) - E_F * np.eye(model.hamiltonians_0.shape[-1])
+        H_int=model.H_int) - E_F * np.eye(model.hamiltonians_0.shape[-1])
 
-- 
GitLab