H = HubbardHamiltonian(H_mol, U=3.5) H.read_density('mol-ref/density.nc') H.iterate(density.calc_n_insulator) p = plot.Charge(H, ext_geom=molecule, colorbar=True) p.savefig('chg.pdf') p = plot.ChargeDifference(H, ext_geom=molecule, colorbar=True) p.savefig('chgdiff.pdf') p = plot.SpinPolarization(H, ext_geom=molecule, colorbar=True, vmax=0.2) p.annotate() p.savefig('pol.pdf') H.H.shift(-H.find_midgap()) ev, evec = H.eigh(eigvals_only=False, spin=0) p = plot.Wavefunction(H, 500 * evec[:, 10], ext_geom=molecule, colorbar=True) p.savefig('wf.pdf') p = plot.Spectrum(H) p.savefig('spectrum.pdf') p = plot.DOSmap(H) p.savefig('2Ddos_map.pdf') p = plot.PDOS(H, np.linspace(-0.2, 0.2, 101)) p.savefig('total_dos.pdf') p = plot.PDOS(H, np.linspace(-0.2, 0.2, 101), sites=[60])
dn = H.converge(density.calc_n, tol=1e-10, steps=10, mixer=mixer) Etot0 = H.Etot n = 1 * H.n # Obtain DOS for the finite molecule with Lorentzian distribution egrid = np.linspace(-1, 1, 50) import hubbard.plot as plot H.H.shift(-H.fermi_level()) p = plot.DOS(H, egrid, eta=1e-2, spin=0) # Now compute same molecule with the WBL approximation with gamma=0 from hubbard.negf import NEGF elec = sisl.WideBandSE(2, 0.) negf = NEGF(H, [elec], [[0, 1]]) # This is to use a better guess for the device potential negf.Ef = H.find_midgap() negf.eta = 1e-2 mixer.clear() dn = H.converge(negf.calc_n_open, mixer=mixer, tol=1e-10, func_args={'qtol': 1e-4}, steps=1, print_info=True) print('Total energy difference: %.4e eV' % (Etot0 - H.Etot)) print('Density difference (up, dn): (%.4e, %.4e)' % (max(abs(H.n[0] - n[0])), max(abs(H.n[1] - n[1])))) # Plot DOS calculated from the diagonalization and the WBL with gamma=0 H.H.shift(-negf.Ef) dos = negf.DOS(H, egrid, spin=0)
import sisl # Build sisl Geometry object mol = sisl.get_sile('type1.xyz').read_geometry() mol.sc.set_nsc([1, 1, 1]) mol = mol.move(-mol.center(what='xyz')).rotate(220, [0, 0, 1]) # 3NN tight-binding model Hsp2 = sp2(mol, t1=2.7, t2=0.2, t3=.18) H = HubbardHamiltonian(Hsp2) # Plot the single-particle TB (U = 0.0) wavefunction (SO) for Type 1 H.U = 0.0 ev, evec = H.eigh(eigvals_only=False, spin=0) N = H.q[0] midgap = H.find_midgap() ev -= midgap f = 3800 v = evec[:, int(round(N)) - 1] j = np.argmax(abs(v)) wf = f * v**2 * np.sign(v[j]) * np.sign(v) p = plot.Wavefunction(H, wf) p.set_title(r'$E = %.3f$ eV' % (ev[int(round(N)) - 1])) p.savefig('Fig3_SOMO.pdf') # Plot MFH spin polarization for U = 3.5 eV H.U = 3.5 success = H.read_density( 'fig3_type1.nc') # Try reading, if we already have density on file if not success: H.set_polarization([23])
molecule = sisl.get_sile('mol-ref/mol-ref.XV').read_geometry() molecule.sc.set_nsc([1, 1, 1]) Hsp2 = sp2(molecule) H = HubbardHamiltonian(Hsp2, U=2.0) H.set_polarization([36], [77]) dn = H.converge(density.calc_n_insulator, mixer=sisl.mixing.LinearMixer(), tol=1e-7) print('Closed-shell spin-polarized calculation:') print('dn: {}, Etot: {}\n'.format(dn, H.Etot)) p = plot.Plot() for i in range(2): ev = H.eigh(spin=i) - H.find_midgap() ev = ev[abs(ev) < 2] p.axes.plot(ev, np.zeros_like(ev), ['or', 'xg'][i], label=[r'$\sigma=\uparrow$', r'$\sigma=\downarrow$'][i]) # Compute same system with spin degeneracy Hsp2 = sp2(molecule, spin='unpolarized') H = HubbardHamiltonian(Hsp2, U=2.0) dn = H.converge(density.calc_n_insulator, mixer=sisl.mixing.LinearMixer(), tol=1e-7) print('Unpolarized calculation:') print('dn: {}, Etot: {}'.format(dn, H.Etot)) ev = H.eigh() - H.find_midgap()