dipc-cc / hubbard

Python tools for mean-field Hubbard models
https://dipc-cc.github.io/hubbard/
GNU Lesser General Public License v3.0
21 stars 8 forks source link

Calculating open structures #91

Closed mlorenznano closed 3 years ago

mlorenznano commented 3 years ago

Hello,

I wanted to calculate the transmission of doped 7AGNR. So I changed a few lines in the example code. I played a little bit around with different things and a few questions appeared:

 Traceback (most recent call last):

   File "/home/lorenz/Desktop/2N-7AGNRopen.py", line 91, in <module>
     MFH_HC.converge(density.dm, tol=1e-5, mixer=mixer)

   File "/home/lorenz/.local/lib/python3.8/site-packages/hubbard/hamiltonian.py", line 542, in converge
     dn = self.iterate(dm_method, mixer=mixer, **func_args)

   File "/home/lorenz/.local/lib/python3.8/site-packages/hubbard/hamiltonian.py", line 477, in iterate
     ddm = ni - self.dm

 ValueError: operands could not be broadcast together with shapes (2,154) (3,154) 

Because unfortunately I know next to nothing about NEGF, the results could be expected butI rather asked you for advice :) Let me know if I you need help understanding my code.

2N-7AGNRopen.txt

sofiasanz commented 3 years ago

Hi!

  • If I change the dopant from nitrogen to boron I see no change in the transmission function. Is this to be expected or did I do a mistake?

Have you changed the onsite energy of the dopant atoms?

  • If I switch from singulet to triplet state I also get the same transmission. Shouldn't there be at least a difference between the output for the up and down spin.

Yes, but the thing is that in the NEGF class we don't impose the spin difference by setting the total number of spin up and down, as in the case for periodic boundary conditions or finite molecules. In this class the self-consistent solution is found by converging towards the total number of electrons, not per spin channel, since in the end the total number of electrons is given by the bath (electrodes). In other words, the fermi level if fixed by the electrodes. As I saw in your calculation the solution is giving you the closed-shell solution with the same number of up and down spins, which is the groundstate.

  • When I tried to run a calculatation with s1, s2 and s3 unequal to zero I got an error message:

OK I see the error. It is related to the function tile inside the HubbadHamiltonian class, this should be fixed soon! Thanks for pointing this out. However, the NEGF class is not yet implemented to accept non-orthogonal basis...

By the way, in line 57 if you want to save the figure of the spin polarization you should save it to an external jpg, png or pdf. You can do it by typing p.savefig('file_name.pdf').

mlorenznano commented 3 years ago

Thank you!

Have you changed the onsite energy of the dopant atoms? No I haven't. How do I do that?

As I saw in your calculation the solution is giving you the closed-shell solution with the same number of up and down spins, which is the groundstate

Ah thanks. Imposing the spin doesn't make much sense. However isn't it a little bit strange that the closed shell solution is the ground state? I chose a device where the ground state should be open shell (I did calculations for the period structure).

By the way, in line 57 if you want to save the figure of the spin polarization you should save it to an external jpg, png or pdf. You can do it by typing p.savefig('file_name.pdf').

Okay great :)

sofiasanz commented 3 years ago

No I haven't. How do I do that?

You can change it like this:

HC[atom_idx, atom_ix] = e0

Where atom_idx represents the atomic index of your dopant atom and e0 is the new onsite energy. You can try with e0=-3 eV. I don't have much experience with Nitrogen though, so I can't tell much more....

Ah thanks. Imposing the spin doesn't make much sense. However isn't it a little bit strange that the closed shell solution is the ground state? I chose a device where the ground state should be open shell (I did calculations for the period structure).

Is it? Because I ran your calculation and if I removed the spin-channel charge difference (so equal number of up and down spins) I got the closed-shell solution, which makes sense since the 7-AGNR is not polarized for U=2 eV.

mlorenznano commented 3 years ago

Where atom_idx represents the atomic index of your dopant atom and e0 is the new onsite energy. You can try with e0=-3 eV. I don't have much experience with Nitrogen though, so I can't tell much more....

I will try it

Is it? Because I ran your calculation and if I removed the spin-channel charge difference (so equal number of up and down spins) I got the closed-shell solution, which makes sense since the 7-AGNR is not polarized for U=2 eV.

I think so. Doped 7-ANGR should display magnetism when N > 7 (N is the number of armchair-units between the doping sites). I calculated the total energy of the periodic structure for S = 1 and S = 0. S = 1 had a slightly lower energy (only a couple of meVs) for every structure with a large enough N.

sofiasanz commented 3 years ago

Shall we close this issue?

mlorenznano commented 3 years ago

Yes we can close it