H.U = u mixer.clear() # AFM case first success = H.read_density( 'clar-goblet.nc') # Try reading, if we already have density on file if not success: H.n = n_AFM.copy() dn = H.converge(density.calc_n_insulator, tol=1e-10, mixer=mixer) eAFM = H.Etot H.write_density('clar-goblet.nc') n_AFM = H.n.copy() if u == 3.5: p = plot.SpinPolarization(H, colorbar=True, vmax=0.4, vmin=-0.4) p.savefig('spin_pol_U%i_AFM.pdf' % (H.U * 1000)) # Now FM case H.q[0] += 1 # change to two more up-electrons than down H.q[1] -= 1 success = H.read_density( 'clar-goblet.nc') # Try reading, if we already have density on file if not success: H.random_density() H.set_polarization(up=[6, 28]) mixer.clear() dn = H.converge(density.calc_n_insulator, tol=1e-10, mixer=mixer) eFM = H.Etot H.write_density('clar-goblet.nc')
p = plot.BondHoppings(H_mol, annotate=False, off_diagonal_only=False, cmap_e='winter') p.legend() p.savefig('bondHoppings.pdf') 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')
# 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]) mixer = sisl.mixing.PulayMixer(0.7, history=7) H.converge(density.calc_n_insulator, mixer=mixer) H.write_density('fig3_type1.nc') p = plot.SpinPolarization(H, ext_geom=mol, vmax=0.20) p.savefig('fig3_pol.pdf')
TBham = sisl.Hamiltonian(g, spin='polarized') for ia in g: ib = g.close(ia, R=[0, 1.42 + 0.1]) io_a = g.a2o(ia, all=True) for iib in ib[1]: io_b = g.a2o(iib, all=True) TBham[io_a[0], io_b[0]] = -2.7 # HubbardHamiltonian object and converge HH = HubbardHamiltonian(TBham, U=None, nkpt=[100, 1, 1]) HH.set_polarization([0], dn=[g.a2o(13)]) HH.converge(density.calc_n, print_info=True, tol=1e-10, steps=3) # Print spin-densities difference compared to sing-orbital case print( '\n ** Difference between spin densities for single and multi-orbital cases **' ) print(HH.n[:, idx] - n_single) # Add second set of bands for the multi orbital case p.add_bands(HH, c='--r') p.savefig('bands.pdf') # Plot charge for multi-orbital case p = plot.Charge(HH, vmin=0.9, vmax=1.1, colorbar=True) p.savefig('charge.pdf') # Plot spin polarization for multi-orbital case p = plot.SpinPolarization(HH, vmax=0.2, vmin=-0.2, colorbar=True) p.savefig('spinpol.pdf')
# Hubbard Hamiltonian of elecs MFH_elec = HubbardHamiltonian(H_elec, U=U, nkpt=[102, 1, 1], kT=kT) # Initial densities success = MFH_elec.read_density('elec_density.nc') if not success: # If no densities saved, start with random densities with maximized polarization at the edges MFH_elec.random_density() MFH_elec.set_polarization([0], dn=[9]) # Converge Electrode Hamiltonians dn = MFH_elec.converge(density.calc_n, mixer=mixer) # Write also densities for future calculations MFH_elec.write_density('elec_density.nc') # Plot spin polarization of electrodes p = plot.SpinPolarization(MFH_elec, colorbar=True) p.savefig('spin_elecs.pdf') # Find Fermi level of reservoirs and write to netcdf file Ef_elecs = MFH_elec.fermi_level(q=MFH_elec.q) MFH_elec.H.shift(-Ef_elecs) MFH_elec.H.write('MFH_elec.nc') # Build central region TB Hamiltonian HC = H_elec.tile(16, axis=0) HC = HC.remove([67, 68, 69, 72, 73, 74, 77, 78, 79, 82, 83, 84, 87, 88, 89]) HC.set_nsc([1, 1, 1]) HC.geometry.write('device.xyz') # Map electrodes in the device region elec_indx = [range(len(H_elec)), range(len(HC.H) - len(H_elec), len(HC.H))]