-
Notifications
You must be signed in to change notification settings - Fork 151
Nexus: First step to ridding us of Particles
#6030
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from 2 commits
27b5745
2356ef7
e1c7996
8d4179d
7847d07
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1675,17 +1675,16 @@ def incorporate_system(self,system,elem_order=None): | |
| system.check_folded_system() | ||
| system.update_particles() | ||
| system.change_units('B') | ||
| p = system.particles | ||
| s = system.structure | ||
| nc = system.net_charge | ||
| ns = system.net_spin | ||
|
|
||
| nup = p.up_electron.count | ||
| ndn = p.down_electron.count | ||
| nup = system.up_electron.count | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| ndn = system.down_electron.count | ||
|
|
||
| self.system.ibrav = 0 | ||
| # self.system['celldm(1)'] = 1.0e0 | ||
| nions,nspecies = p.count_ions(species=True) | ||
| nions,nspecies = system.count_ions(species=True) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| self.system.nat = nions | ||
| self.system.ntyp = nspecies | ||
| self.system.tot_charge = nc | ||
|
|
@@ -1717,7 +1716,7 @@ def incorporate_system(self,system,elem_order=None): | |
| #end if | ||
| #end if | ||
|
|
||
| atoms = p.get_ions() | ||
| atoms = system.get_ions() | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| if 'masses' not in self.atomic_species: | ||
| self.atomic_species.masses = obj() | ||
| #end if | ||
|
|
@@ -1739,7 +1738,7 @@ def incorporate_system(self,system,elem_order=None): | |
| pp = self.atomic_species.pseudopotentials | ||
| for atom in self.atomic_species.atoms: | ||
| if atom not in pp: | ||
| iselem,symbol = p.is_element(atom,symbol=True) | ||
| iselem,symbol = system.is_element(atom,symbol=True) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use |
||
| if iselem and symbol in pp: | ||
| pp[atom] = str(pp[symbol]) | ||
| #end if | ||
|
|
@@ -1770,17 +1769,16 @@ def incorporate_system_old(self,system,spin_polarized=None): | |
| system.check_folded_system() | ||
| system.update_particles() | ||
| system.change_units('B') | ||
| p = system.particles | ||
| s = system.structure | ||
| nc = system.net_charge | ||
| ns = system.net_spin | ||
|
|
||
| nup = p.up_electron.count | ||
| ndn = p.down_electron.count | ||
| nup = system.up_electron.count | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| ndn = system.down_electron.count | ||
|
|
||
| self.system.ibrav = 0 | ||
| # self.system['celldm(1)'] = 1.0e0 | ||
| nions,nspecies = p.count_ions(species=True) | ||
| nions,nspecies = system.count_ions(species=True) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| self.system.nat = nions | ||
| self.system.ntyp = nspecies | ||
| #self.system.nelec = nup+ndn | ||
|
|
@@ -1819,7 +1817,7 @@ def incorporate_system_old(self,system,spin_polarized=None): | |
| #end if | ||
| #end if | ||
|
|
||
| atoms = p.get_ions() | ||
| atoms = system.get_ions() | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| masses = obj() | ||
| for name,a in atoms.items(): | ||
| masses[name] = convert(a.mass,'me','amu') | ||
|
|
@@ -1830,7 +1828,7 @@ def incorporate_system_old(self,system,spin_polarized=None): | |
| pp = self.atomic_species.pseudopotentials | ||
| for atom in self.atomic_species.atoms: | ||
| if atom not in pp: | ||
| iselem,symbol = p.is_element(atom,symbol=True) | ||
| iselem,symbol = system.is_element(atom,symbol=True) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use |
||
| if iselem and symbol in pp: | ||
| pp[atom] = str(pp[symbol]) | ||
| #end if | ||
|
|
@@ -2265,7 +2263,7 @@ def generate_any_pwscf_input(**kwargs): | |
|
|
||
| # set nbnd using bandfac, if provided | ||
| if nbnd is None and bandfac is not None: | ||
| nocc = max(system.particles.electron_counts()) | ||
| nocc = max(system.electron_counts()) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| pw.system.nbnd = int(np.ceil(nocc*bandfac)) | ||
| #end if | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -188,11 +188,11 @@ def unfolded_nelecs(self): | |
| Returns the number of electrons in the primitive cell | ||
| ''' | ||
| if self.system.folded_system is None: | ||
| n_up = self.system.particles.up_electron.count | ||
| n_dn = self.system.particles.down_electron.count | ||
| n_up = self.system.up_electron.count | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| n_dn = self.system.down_electron.count | ||
| else: | ||
| n_up = self.system.folded_system.particles.up_electron.count | ||
| n_dn = self.system.folded_system.particles.down_electron.count | ||
| n_up = self.system.folded_system.up_electron.count | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| n_dn = self.system.folded_system.down_electron.count | ||
| #end if | ||
| nelecs = n_up + n_dn | ||
| return nelecs | ||
|
|
@@ -463,8 +463,8 @@ def sum_charge_twists(self): | |
| ''' | ||
| Returns the net charge of a system with multiple twists (not averaged) | ||
| ''' | ||
| n_up = self.system.particles.up_electron.count | ||
| n_dn = self.system.particles.down_electron.count | ||
| n_up = self.system.up_electron.count | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| n_dn = self.system.down_electron.count | ||
| n_total = n_up + n_dn | ||
| nelecs_at_twist = self.nelecs_at_twist | ||
| kweights = np.array(self.system.structure.kweights) | ||
|
|
@@ -536,8 +536,8 @@ def write_gcta_report(self, locdir, fermi_level, scf_magnet = None): | |
| spin_sum_twists = self.sum_spin_twists() | ||
| qmc_magnet = spin_sum_twists / nosym_kpoints | ||
| #end if | ||
| n_up = self.system.particles.up_electron.count | ||
| n_dn = self.system.particles.down_electron.count | ||
| n_up = self.system.up_electron.count | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| n_dn = self.system.down_electron.count | ||
| n_total = n_up + n_dn | ||
| nelecs_at_twist = self.nelecs_at_twist | ||
| fermi_level = np.array(fermi_level) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.