bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
def get_potential_energy(self,atoms=None,force_consistent=False): ''' return the potential energy. ''' if self.calculation_required(atoms): if self.debug > 0: print 'calculation required for energy' self.calculate() else: if self.debug > 0: print 'no calculation required for energy' nc = netCDF(self.get_nc(),'r') try:... | def get_potential_energy(self,atoms=None,force_consistent=False): ''' return the potential energy. ''' if self.calculation_required(atoms): if self.debug > 0: print 'calculation required for energy' self.calculate() else: log.debug('no calculation required for energy') nc = netCDF(self.get_nc(),'r') try: if force_cons... | 454,600 |
def get_potential_energy(self,atoms=None,force_consistent=False): ''' return the potential energy. ''' if self.calculation_required(atoms): if self.debug > 0: print 'calculation required for energy' self.calculate() else: if self.debug > 0: print 'no calculation required for energy' nc = netCDF(self.get_nc(),'r') try:... | def get_potential_energy(self,atoms=None,force_consistent=False): ''' return the potential energy. ''' if self.calculation_required(atoms): if self.debug > 0: print 'calculation required for energy' self.calculate() else: if self.debug > 0: print 'no calculation required for energy' nc = netCDF(self.get_nc(),'r') try:... | 454,601 |
def get_forces(self, atoms=None): """Calculate atomic forces""" if atoms is None: atoms = self.atoms if self.calculation_required(atoms): if self.debug > 0: print 'calculation required for forces' self.calculate() nc = netCDF(self.get_nc(),'r') forces = nc.variables['DynamicAtomForces'][-1] nc.close() return forces | def get_forces(self, atoms=None): """Calculate atomic forces""" if atoms is None: atoms = self.atoms if self.calculation_required(atoms): self.calculate() nc = netCDF(self.get_nc(),'r') forces = nc.variables['DynamicAtomForces'][-1] nc.close() return forces | 454,602 |
def calculation_required(self, atoms=None, quantities=None): ''' determines if a calculation is needed. | def calculation_required(self, atoms=None, quantities=None): ''' determines if a calculation is needed. | 454,603 |
def calculation_required(self, atoms=None, quantities=None): ''' determines if a calculation is needed. | def calculation_required(self, atoms=None, quantities=None): ''' determines if a calculation is needed. | 454,604 |
def calculation_required(self, atoms=None, quantities=None): ''' determines if a calculation is needed. | def calculation_required(self, atoms=None, quantities=None): ''' determines if a calculation is needed. | 454,605 |
def calculation_required(self, atoms=None, quantities=None): ''' determines if a calculation is needed. | def calculation_required(self, atoms=None, quantities=None): ''' determines if a calculation is needed. | 454,606 |
def calculation_required(self, atoms=None, quantities=None): ''' determines if a calculation is needed. | def calculation_required(self, atoms=None, quantities=None): ''' determines if a calculation is needed. | 454,607 |
def calculation_required(self, atoms=None, quantities=None): ''' determines if a calculation is needed. | def calculation_required(self, atoms=None, quantities=None): ''' determines if a calculation is needed. | 454,608 |
def calculation_required(self, atoms=None, quantities=None): ''' determines if a calculation is needed. | def calculation_required(self, atoms=None, quantities=None): ''' determines if a calculation is needed. | 454,609 |
def calculation_required(self, atoms=None, quantities=None): ''' determines if a calculation is needed. | def calculation_required(self, atoms=None, quantities=None): ''' determines if a calculation is needed. | 454,610 |
def calculation_required(self, atoms=None, quantities=None): ''' determines if a calculation is needed. | def calculation_required(self, atoms=None, quantities=None): ''' determines if a calculation is needed. | 454,611 |
def calculate(self): '''run a calculation. | def calculate(self): '''run a calculation. | 454,612 |
def calculate(self): '''run a calculation. | def calculate(self): '''run a calculation. | 454,613 |
def execute_external_dynamics(self, nc=None, txt=None, stoppfile='stop', stopprogram=None): ''' Implementation of the stay alive functionality with socket communication between dacapo and python. Known limitations: It is not possible to start 2 independent Dacapo calculators from the same python process, since the pyt... | def execute_external_dynamics(self, nc=None, txt=None, stoppfile='stop', stopprogram=None): ''' Implementation of the stay alive functionality with socket communication between dacapo and python. Known limitations: It is not possible to start 2 independent Dacapo calculators from the same python process, since the pyt... | 454,614 |
def execute_external_dynamics(self, nc=None, txt=None, stoppfile='stop', stopprogram=None): ''' Implementation of the stay alive functionality with socket communication between dacapo and python. Known limitations: It is not possible to start 2 independent Dacapo calculators from the same python process, since the pyt... | def execute_external_dynamics(self, nc=None, txt=None, stoppfile='stop', stopprogram=None): ''' Implementation of the stay alive functionality with socket communication between dacapo and python. Known limitations: It is not possible to start 2 independent Dacapo calculators from the same python process, since the pyt... | 454,615 |
def write_nc(self,nc=None,atoms=None): ''' write out a netcdffile. This does not change the ncfile attached to the calculator! | def write_nc(self,nc=None,atoms=None): ''' write out a netcdffile. This does not change the ncfile attached to the calculator! | 454,616 |
def delete_ncattdimvar(self,ncf,ncattrs=(),ncdims=(),ncvars=()): ''' helper function to delete attributes, dimensions and variables in a netcdffile | def delete_ncattdimvar(self,ncf,ncattrs=(),ncdims=(),ncvars=()): ''' helper function to delete attributes, dimensions and variables in a netcdffile | 454,617 |
def delete_ncattdimvar(self,ncf,ncattrs=(),ncdims=(),ncvars=()): ''' helper function to delete attributes, dimensions and variables in a netcdffile | def delete_ncattdimvar(self,ncf,ncattrs=(),ncdims=(),ncvars=()): ''' helper function to delete attributes, dimensions and variables in a netcdffile | 454,618 |
def delete_ncattdimvar(self,ncf,ncattrs=(),ncdims=(),ncvars=()): ''' helper function to delete attributes, dimensions and variables in a netcdffile | def delete_ncattdimvar(self,ncf,ncattrs=(),ncdims=(),ncvars=()): ''' helper function to delete attributes, dimensions and variables in a netcdffile | 454,619 |
def delete_ncattdimvar(self,ncf,ncattrs=(),ncdims=(),ncvars=()): ''' helper function to delete attributes, dimensions and variables in a netcdffile | def delete_ncattdimvar(self,ncf,ncattrs=(),ncdims=(),ncvars=()): ''' helper function to delete attributes, dimensions and variables in a netcdffile | 454,620 |
def delete_ncattdimvar(self,ncf,ncattrs=(),ncdims=(),ncvars=()): ''' helper function to delete attributes, dimensions and variables in a netcdffile | def delete_ncattdimvar(self,ncf,ncattrs=(),ncdims=(),ncvars=()): ''' helper function to delete attributes, dimensions and variables in a netcdffile | 454,621 |
def delete_ncattdimvar(self,ncf,ncattrs=(),ncdims=(),ncvars=()): ''' helper function to delete attributes, dimensions and variables in a netcdffile | def delete_ncattdimvar(self,ncf,ncattrs=(),ncdims=(),ncvars=()): ''' helper function to delete attributes, dimensions and variables in a netcdffile | 454,622 |
def delete_ncattdimvar(self,ncf,ncattrs=(),ncdims=(),ncvars=()): ''' helper function to delete attributes, dimensions and variables in a netcdffile | def delete_ncattdimvar(self,ncf,ncattrs=(),ncdims=(),ncvars=()): ''' helper function to delete attributes, dimensions and variables in a netcdffile | 454,623 |
def restart(self): ''' Restart the calculator by deleting nc dimensions that will be rewritten on the next calculation. This is sometimes required when certain dimensions change related to unitcell size changes planewave/densitywave cutoffs and kpt changes. These can cause fortran netcdf errors if the data does not mat... | def restart(self): ''' Restart the calculator by deleting nc dimensions that will be rewritten on the next calculation. This is sometimes required when certain dimensions change related to unitcell size changes planewave/densitywave cutoffs and kpt changes. These can cause fortran netcdf errors if the data does not mat... | 454,624 |
def cut(atoms, a=(1,0,0), b=(0,1,0), c=(0,0,1), origo=(0,0,0), nlayers=None, extend=1.0, tolerance=0.001): """Cuts out a cell defined by *a*, *b*, *c* and *origo* from a sufficiently repeated copy of *atoms*. Typically, this function is used to create slabs of different sizes and orientations. The vectors *a*, *b* and... | def cut(atoms, a=(1,0,0), b=(0,1,0), c=(0,0,1), origo=(0,0,0), nlayers=None, extend=1.0, tolerance=0.001): """Cuts out a cell defined by *a*, *b*, *c* and *origo* from a sufficiently repeated copy of *atoms*. Typically, this function is used to create slabs of different sizes and orientations. The vectors *a*, *b* and... | 454,625 |
def __init__(self, label='dftb', write_dftb=False, charge=0.0, include_dispersion=False, do_spin_polarized=False, unpaired_electrons=0.0, fermi_temperature=0.0, scc=False, kpt_n11=1, kpt_n12=0, kpt_n13=0, kpt_n21=0, kpt_n22=1, kpt_n23=0, kpt_n31=0, kpt_n32=0, kpt_n33=1, kpt_s1=0.0, kpt_s2=0.0, kpt_s3=0.0, md_dftb=False... | def __init__(self, label='dftb', write_dftb=False, charge=0.0, include_dispersion=False, do_spin_polarized=False, unpaired_electrons=0.0, fermi_temperature=0.0, scc=False, kpt_n11=1, kpt_n12=0, kpt_n13=0, kpt_n21=0, kpt_n22=1, kpt_n23=0, kpt_n31=0, kpt_n32=0, kpt_n33=1, kpt_s1=0.0, kpt_s2=0.0, kpt_s3=0.0, md_dftb=False... | 454,626 |
def kpts_changed(calc, x): ''' check if kpt grid has changed. we have to take care to generate teh right k-points from x if needed. if a user provides (4,4,4) we need to generate the MP grid, etc... Since i changed the MP code in set_kpts, there is some incompatibility with old jacapo calculations and their MP grids.... | def kpts_changed(calc, x): ''' check if kpt grid has changed. we have to take care to generate the right k-points from x if needed. if a user provides (4,4,4) we need to generate the MP grid, etc... Since i changed the MP code in set_kpts, there is some incompatibility with old jacapo calculations and their MP grids.... | 454,627 |
def kpts_changed(calc, x): ''' check if kpt grid has changed. we have to take care to generate teh right k-points from x if needed. if a user provides (4,4,4) we need to generate the MP grid, etc... Since i changed the MP code in set_kpts, there is some incompatibility with old jacapo calculations and their MP grids.... | def kpts_changed(calc, x): ''' check if kpt grid has changed. we have to take care to generate teh right k-points from x if needed. if a user provides (4,4,4) we need to generate the MP grid, etc... Since i changed the MP code in set_kpts, there is some incompatibility with old jacapo calculations and their MP grids.... | 454,628 |
def read_aims_output(filename, index = -1): """ Import FHI-aims output files with all data available, i.e. relaxations, MD information, force information etc etc etc. """ from ase import Atoms, Atom from ase.calculators.singlepoint import SinglePointCalculator from ase.units import Ang, fs molecular_dynamics = False f... | def read_aims_output(filename, index = -1): """ Import FHI-aims output files with all data available, i.e. relaxations, MD information, force information etc etc etc. """ from ase import Atoms, Atom from ase.calculators.singlepoint import SinglePointCalculator from ase.units import Ang, fs molecular_dynamics = False f... | 454,629 |
def run(self): """Run the vibration calculations. | def run(self): """Run the vibration calculations. | 454,630 |
def run(self): """Run the vibration calculations. | def run(self): """Run the vibration calculations. | 454,631 |
def run(self): """Run the vibration calculations. | def run(self): """Run the vibration calculations. | 454,632 |
def execute_external_dynamics(self, nc=None, txt=None, stoppfile='stop', stopprogram=None): ''' Implementation of the stay alive functionality with socket communication between dacapo and python. Known limitations: It is not possible to start 2 independent Dacapo calculators from the same python process, since the pyt... | def execute_external_dynamics(self, nc=None, txt=None, stoppfile='stop', stopprogram=None): ''' Implementation of the stay alive functionality with socket communication between dacapo and python. Known limitations: It is not possible to start 2 independent Dacapo calculators from the same python process, since the pyt... | 454,633 |
def __init__(self, gui): Simulation.__init__(self, gui) self.set_title("Homogeneous scaling") vbox = gtk.VBox() self.packtext(vbox, "XXXX Bla bla bla.") self.packimageselection(vbox, txt1="", txt2="") self.start_radio_nth.set_active(True) pack(vbox, gtk.Label("")) | def __init__(self, gui): Simulation.__init__(self, gui) self.set_title("Homogeneous scaling") vbox = gtk.VBox() self.packtext(vbox, scaling_txt) self.packimageselection(vbox, txt1="", txt2="") self.start_radio_nth.set_active(True) pack(vbox, gtk.Label("")) | 454,634 |
framedef = gtk.Frame("Deformation:") | framedef = gtk.Frame("Deformation:") | 454,635 |
def __init__(self, gui): SetupWindow.__init__(self) self.set_title("Nanotube") vbox = gtk.VBox() | def __init__(self, gui): SetupWindow.__init__(self) self.set_title("Graphene") vbox = gtk.VBox() | 454,636 |
def get_spectrum(self, start=800, end=4000, npts=None, width=4, type='Gaussian', method='standard', direction='central'): """Get infrared spectrum. | def get_spectrum(self, start=800, end=4000, npts=None, width=4, type='Gaussian', method='standard', direction='central'): """Get infrared spectrum. | 454,637 |
def mol_role(role, rawtext, text, lineno, inliner, options={}, content=[]): n = [] t = '' while text: if text[0] == '_': n.append(nodes.inline(text=t)) t = '' n.append(nodes.subscript(text=text[1])) text = text[2:] else: t += text[0] text = text[1:] n.append(nodes.inline(text=t)) return n, [] | def mol_role(role, rawtext, text, lineno, inliner, options={}, content=[]): n = [] t = '' while text: if text[0] == '_': n.append(nodes.Text(t)) t = '' n.append(nodes.subscript(text=text[1])) text = text[2:] else: t += text[0] text = text[1:] n.append(nodes.Text(t)) return n, [] | 454,638 |
def mol_role(role, rawtext, text, lineno, inliner, options={}, content=[]): n = [] t = '' while text: if text[0] == '_': n.append(nodes.inline(text=t)) t = '' n.append(nodes.subscript(text=text[1])) text = text[2:] else: t += text[0] text = text[1:] n.append(nodes.inline(text=t)) return n, [] | def mol_role(role, rawtext, text, lineno, inliner, options={}, content=[]): n = [] t = '' while text: if text[0] == '_': n.append(nodes.Text(t)) t = '' n.append(nodes.subscript(text=text[1])) text = text[2:] else: t += text[0] text = text[1:] n.append(nodes.Text(t)) return n, [] | 454,639 |
def save(self, action): chooser = gtk.FileChooserDialog( _('Save ...'), None, gtk.FILE_CHOOSER_ACTION_SAVE, (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_SAVE, gtk.RESPONSE_OK)) | def save(self, action): chooser = gtk.FileChooserDialog( _('Save ...'), None, gtk.FILE_CHOOSER_ACTION_SAVE, (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_SAVE, gtk.RESPONSE_OK)) | 454,640 |
def __init__(self, gui): Simulation.__init__(self, gui) self.set_title("Homogeneous scaling") vbox = gtk.VBox() self.packtext(vbox, "XXXX Bla bla bla.") self.packimageselection(vbox) pack(vbox, gtk.Label("")) | def __init__(self, gui): Simulation.__init__(self, gui) self.set_title("Homogeneous scaling") vbox = gtk.VBox() self.packtext(vbox, "XXXX Bla bla bla.") self.packimageselection(vbox) pack(vbox, gtk.Label("")) | 454,641 |
def choose_possible_deformations(self): """Turn on sensible radio buttons. | def choose_possible_deformations(self, first=False): """Turn on sensible radio buttons. | 454,642 |
def get_deformation_axes(self): """Return which axes the user wants to deform along.""" for but, deform in self.deformtable: if but.get_active() and but.get_sensitive(): return np.array(deform) # No deformation chosen! oops("No deformation chosen: Please choose a deformation mode.") return False | def get_deformation_axes(self): """Return which axes the user wants to deform along.""" for but, deform in self.deformtable: if but.get_active(): return np.array(deform) # No deformation chosen! oops("No deformation chosen: Please choose a deformation mode.") return False | 454,643 |
def new_atoms(self, atoms, init_magmom=False): "Set a new atoms object." self.notify_vulnerable() self.reset_tools_modes() rpt = getattr(self.images, 'repeat', None) self.images.repeat_images(np.ones(3, int)) self.images.initialize([atoms], init_magmom=init_magmom) self.frame = 0 # Prevent crashes self.images.repeat... | def new_atoms(self, atoms, init_magmom=False): "Set a new atoms object." self.reset_tools_modes() rpt = getattr(self.images, 'repeat', None) self.images.repeat_images(np.ones(3, int)) self.images.initialize([atoms], init_magmom=init_magmom) self.frame = 0 # Prevent crashes self.images.repeat_images(rpt) self.set_col... | 454,644 |
def set_frame(self, frame=None, focus=False, init=False): if frame is None: frame = self.frame | def set_frame(self, frame=None, focus=False, init=False): if frame is None: frame = self.frame | 454,645 |
def set(self, **kwargs): '''set a parameter | def set(self, **kwargs): '''set a parameter | 454,646 |
def valid_int(x): return isinstance(x, int) | def valid_int(x): if (isinstance(x, int) or isinstance(x,np.int32)): return True | 454,647 |
def valid_int_or_float(x): return (isinstance(x, int) or isinstance(x, float)) | def valid_int_or_float(x): return ((isinstance(x, int) or isinstance(x,np.int32)) or isinstance(x, float)) | 454,648 |
def valid_kpts(x): if isinstance(x, str): return x in ['cc-6-1x1', 'cc-12-2x3', 'cc-18-sq3xsq3', 'cc-18-1x1', 'cc-54-sq3xsq3', 'cc-54-1x1', 'cc-162-1x1'] x = np.array(x) #empty arg is no good if x.shape == (): return False #monkhorst-pack elif x.shape == (3,) and ((x.dtype == 'int32') or (x.dtype == 'int64')): return T... | def valid_kpts(x): if isinstance(x, str): return x in ['cc6_1x1', 'cc12_2x3', 'cc18_sq3xsq3', 'cc18_1x1', 'cc54_sq3xsq3', 'cc54_1x1', 'cc162_sq3xsq3', 'cc162_1x1'] x = np.array(x) #empty arg is no good if x.shape == (): return False #monkhorst-pack elif x.shape == (3,) and ((x.dtype == 'int32') or (x.dtype == 'int64'))... | 454,649 |
def set_psp(self, sym=None, z=None, psp=None): ''' set the pseudopotential file for a species or an atomic number. | def set_psp(self, sym=None, z=None, psp=None): ''' set the pseudopotential file for a species or an atomic number. | 454,650 |
def set_psp(self, sym=None, z=None, psp=None): ''' set the pseudopotential file for a species or an atomic number. | defelif self.psp[sym] != psp: self.psp[sym] = psp self.ready = False self.set_status('new') if not self.ready: set_psp(self,elif self.psp[sym] != psp: self.psp[sym] = psp self.ready = False self.set_status('new') if not self.ready: sym=None,elif self.psp[sym] != psp: self.psp[sym] = psp self.ready = False self.set_st... | 454,651 |
def restart(self): ''' Restart the calculator by deleting nc dimensions that will be rewritten on the next calculation. This is sometimes required when certain dimensions change related to unitcell size changes planewave/densitywave cutoffs and kpt changes. These can cause fortran netcdf errors if the data does not mat... | def restart(self): ''' Restart the calculator by deleting nc dimensions that will be rewritten on the next calculation. This is sometimes required when certain dimensions change related to unitcell size changes planewave/densitywave cutoffs and kpt changes. These can cause fortran netcdf errors if the data does not mat... | 454,652 |
def restart(self): ''' Restart the calculator by deleting nc dimensions that will be rewritten on the next calculation. This is sometimes required when certain dimensions change related to unitcell size changes planewave/densitywave cutoffs and kpt changes. These can cause fortran netcdf errors if the data does not mat... | def restart(self): ''' Restart the calculator by deleting nc dimensions that will be rewritten on the next calculation. This is sometimes required when certain dimensions change related to unitcell size changes planewave/densitywave cutoffs and kpt changes. These can cause fortran netcdf errors if the data does not mat... | 454,653 |
def set_frame(self, frame=None, focus=False, init=False): if frame is None: frame = self.frame | def set_frame(self, frame=None, focus=False, init=False): if frame is None: frame = self.frame | 454,654 |
def scroll(self, window, event): from copy import copy CTRL = event.state == gtk.gdk.CONTROL_MASK SHIFT = event.state == gtk.gdk.SHIFT_MASK dxdydz = {gtk.keysyms.KP_Add: ('zoom', 1.2, 0), gtk.keysyms.KP_Subtract: ('zoom', 1 / 1.2), gtk.keysyms.Up: ( 0, -1 + CTRL, +CTRL), gtk.keysyms.Down: ( 0, +1 - CTRL, -CTRL), gt... | def scroll(self, window, event): from copy import copy CTRL = event.state == gtk.gdk.CONTROL_MASK SHIFT = event.state == gtk.gdk.SHIFT_MASK dxdydz = {gtk.keysyms.KP_Add: ('zoom', 1.2, 0), gtk.keysyms.KP_Subtract: ('zoom', 1 / 1.2), gtk.keysyms.Up: ( 0, -1 + CTRL, +CTRL), gtk.keysyms.Down: ( 0, +1 - CTRL, -CTRL), gt... | 454,655 |
def build(): p = OptionParser(usage='%prog [options] [ads@]surf [output file]', version='%prog 0.1', description='Example ads/surf: CO@2x2Ru0001') p.add_option('-l', '--layers', type='int', default=4, help='Number of layers.') p.add_option('-v', '--vacuum', type='float', default=5.0, help='Vacuum.') p.add_option('-x',... | def build(): p = OptionParser(usage='%prog [options] [ads@]surf [output file]', version='%prog 0.1', description='Example ads/surf: CO@2x2Ru0001') p.add_option('-l', '--layers', type='int', default=4, help='Number of layers.') p.add_option('-v', '--vacuum', type='float', default=5.0, help='Vacuum.') p.add_option('-x',... | 454,656 |
def __init__(self, nc='out.nc', outnc=None, debug=logging.WARN, stay_alive=False, **kwargs): ''' Initialize the Jacapo calculator | def __init__(self, nc='out.nc', outnc=None, debug=logging.WARN, stay_alive=False, **kwargs): ''' Initialize the Jacapo calculator | 454,657 |
def set_nc(self, nc='out.nc'): ''' set filename for the netcdf and text output for this calculation | def set_nc(self, nc='out.nc'): ''' set filename for the netcdf and text output for this calculation | 454,658 |
def set_electronic_minimization(self, method, diagsperband=None): '''set the eigensolver method | def set_electronic_minimization(self, method='eigsolve', diagsperband=2): '''set the eigensolver method | 454,659 |
def get_dipole_moment(self): ''' return dipole moment of unit cell | def get_dipole_moment(self,atoms=None): ''' return dipole moment of unit cell | 454,660 |
def get_dipole_moment(self): ''' return dipole moment of unit cell | def get_dipole_moment(self): ''' return dipole moment of unit cell | 454,661 |
def __init__(self, energy, forces, stress, magmoms, atoms): """Save energy, forces and stresses for the current configuration.""" self.energy = energy self.forces = np.array(forces, float) self.stress = np.array(stress, float) self.magmoms = np.array(magmoms, float) self.atoms = atoms.copy() | def __init__(self, energy, forces, stress, magmoms, atoms): """Save energy, forces and stresses for the current configuration.""" self.energy = energy if forces is not None: forces = np.array(forces, float) self.forces = forces if stress is not None: stress = np.array(stress, float) self.stress = stress if magmoms is n... | 454,662 |
def get_magnetic_moments(self, atoms): if self.int_params['lorbit']>=10 or self.list_params['rwigs']: self.update(atoms) return self.magnetic_moments else: raise RuntimeError( "The combination %s for lorbit with %s for rwigs not supported to calculate magnetic moments" % (p['lorbit'], p['rwigs'])) | def get_magnetic_moments(self, atoms): if self.int_params['lorbit']>=10 or self.list_params['rwigs']: self.update(atoms) return self.magnetic_moments else: raise RuntimeError( "The combination %s for lorbit with %s for rwigs not supported to calculate magnetic moments" % (p['lorbit'], p['rwigs'])) | 454,663 |
def read_only_atoms(self,ncfile): '''read only the atoms from an existing netcdf file. Used to initialize a calculator from a ncfilename. | def read_only_atoms(self,ncfile): '''read only the atoms from an existing netcdf file. Used to initialize a calculator from a ncfilename. | 454,664 |
def birch(self,parameters,V): ''' From Intermetallic compounds: Principles and Practice, Vol. I: Princples Chapter 9 pages 195-210 by M. Mehl. B. Klein, D. Papaconstantopoulos paper downloaded from Web | def birch(self,parameters,V): ''' From Intermetallic compounds: Principles and Practice, Vol. I: Principles Chapter 9 pages 195-210 by M. Mehl. B. Klein, D. Papaconstantopoulos paper downloaded from Web | 454,665 |
def build(): p = OptionParser(usage='%prog [options] [ads@]surf [output file]', version='%prog 0.1', description='Example ads/surf: CO@2x2Ru0001') p.add_option('-l', '--layers', type='int', default=4, help='Number of layers.') p.add_option('-v', '--vacuum', type='float', default=5.0, help='Vacuum.') p.add_option('-x',... | def build(): p = OptionParser(usage='%prog [options] [ads@]surf [output file]', version='%prog 0.1', description='Example ads/surf: CO@2x2Ru0001') p.add_option('-l', '--layers', type='int', default=4, help='Number of layers.') p.add_option('-v', '--vacuum', type='float', default=5.0, help='Vacuum.') p.add_option('-x',... | 454,666 |
def build(): p = OptionParser(usage='%prog [options] [ads@]surf [output file]', version='%prog 0.1', description='Example ads/surf: CO@2x2Ru0001') p.add_option('-l', '--layers', type='int', default=4, help='Number of layers.') p.add_option('-v', '--vacuum', type='float', default=5.0, help='Vacuum.') p.add_option('-x',... | def build(): p = OptionParser(usage='%prog [options] [ads@]surf [output file]', version='%prog 0.1', description='Example ads/surf: CO@2x2Ru0001') p.add_option('-l', '--layers', type='int', default=4, help='Number of layers.') p.add_option('-v', '--vacuum', type='float', default=5.0, help='Vacuum.') p.add_option('-x',... | 454,667 |
def kpts_changed(calc, x): ''' check if kpt grid has changed. we have to take care to generate teh right k-points from x if needed. if a user provides (4,4,4) we need to generate the MP grid, etc... Since i changed the MP code in set_kpts, there is some incompatibility with old jacapo calculations and their MP grids.... | def kpts_changed(calc, x): ''' check if kpt grid has changed. we have to take care to generate teh right k-points from x if needed. if a user provides (4,4,4) we need to generate the MP grid, etc... Since i changed the MP code in set_kpts, there is some incompatibility with old jacapo calculations and their MP grids.... | 454,668 |
def write_svnrevision(output): f = open(path.join('ase', 'svnrevision.py'),'w') f.write('svnrevision = "%s"\n' % output) f.close() print 'svnrevision = ' +output+' written to ase/svnrevision.py' # assert svn:ignore property if the installation is under svn control # because svnrevision.py has to be ignored by svn! cmd ... | def write_svnrevision(output, asedir='ase'): fname = path.join(asedir, 'svnrevision.py') f = open(fname,'w') f.write('svnrevision = "%s"\n' % output) f.close() print 'svnrevision = ' +output+' written to ase/svnrevision.py' # assert svn:ignore property if the installation is under svn control # because svnrevision.py h... | 454,669 |
def write_svnrevision(output): f = open(path.join('ase', 'svnrevision.py'),'w') f.write('svnrevision = "%s"\n' % output) f.close() print 'svnrevision = ' +output+' written to ase/svnrevision.py' # assert svn:ignore property if the installation is under svn control # because svnrevision.py has to be ignored by svn! cmd ... | def write_svnrevision(output): f = open(path.join('ase', 'svnrevision.py'),'w') f.write('svnrevision = "%s"\n' % output) f.close() print 'svnrevision = ' + output + ' written to ' + fname # assert svn:ignore property if the installation is under svn control # because svnrevision.py has to be ignored by svn! cmd = popen... | 454,670 |
def write_svnrevision(output): f = open(path.join('ase', 'svnrevision.py'),'w') f.write('svnrevision = "%s"\n' % output) f.close() print 'svnrevision = ' +output+' written to ase/svnrevision.py' # assert svn:ignore property if the installation is under svn control # because svnrevision.py has to be ignored by svn! cmd ... | def write_svnrevision(output): f = open(path.join('ase', 'svnrevision.py'),'w') f.write('svnrevision = "%s"\n' % output) f.close() print 'svnrevision = ' +output+' written to ase/svnrevision.py' # assert svn:ignore property if the installation is under svn control # because svnrevision.py has to be ignored by svn! cmd ... | 454,671 |
def read_aims(filename): """Import FHI-aims geometry type files. Reads unitcell, atom positions and constraints from a geometry.in file. """ from ase import Atoms from ase.constraints import FixAtoms, FixCartesian import numpy as np atoms = Atoms() fd = open(filename, 'r') lines = fd.readlines() fd.close() positions... | def read_aims(filename): """Import FHI-aims geometry type files. Reads unitcell, atom positions and constraints from a geometry.in file. """ from ase import Atoms from ase.constraints import FixAtoms, FixCartesian import numpy as np atoms = Atoms() fd = open(filename, 'r') lines = fd.readlines() fd.close() positions... | 454,672 |
def write_aims(filename, atoms): """Method to write FHI-aims geometry files. Writes the atoms positions and constraints (only FixAtoms is supported at the moment). """ from ase.constraints import FixAtoms, FixCartesian import numpy as np if isinstance(atoms, (list, tuple)): if len(atoms) > 1: raise RuntimeError("Don... | def write_aims(filename, atoms): """Method to write FHI-aims geometry files. Writes the atoms positions and constraints (only FixAtoms is supported at the moment). """ from ase.constraints import FixAtoms, FixCartesian import numpy as np if isinstance(atoms, (list, tuple)): if len(atoms) > 1: raise RuntimeError("Don... | 454,673 |
def valid_ascii_debug(x): return (x in ['Off', 'MediumLevel', 'HighLevel']) | def valid_ascii_debug(x): return (x.strip() in ['Off', 'MediumLevel', 'HighLevel']) | 454,674 |
def valid_electronic_minimization(x): valid_keys = ['method', 'diagsperband'] for key in x: if key not in valid_keys: return False elif key == 'method': if x[key] not in ['resmin', 'eigsolve', 'rmm-diis']: return False elif key == 'diagsperband': if not valid_int(x[key]): return False return True | def valid_electronic_minimization(x): valid_keys = ['method', 'diagsperband'] for key in x: if key not in valid_keys: return False elif key == 'method': if x[key] not in ['resmin', 'eigsolve', 'rmm-diis']: return False elif key == 'diagsperband': if not (valid_int(x[key]) or x[key] is None): return False return True | 454,675 |
def kpts_changed(calc, x): ''' check if kpt grid has changed. we have to take care to generate teh right k-points from x if needed. if a user provides (4,4,4) we need to generate the MP grid, etc... Since i changed the MP code in set_kpts, there is some incompatibility with old jacapo calculations and their MP grids.... | def kpts_changed(calc, x): ''' check if kpt grid has changed. we have to take care to generate teh right k-points from x if needed. if a user provides (4,4,4) we need to generate the MP grid, etc... Since i changed the MP code in set_kpts, there is some incompatibility with old jacapo calculations and their MP grids.... | 454,676 |
def kpts_changed(calc, x): ''' check if kpt grid has changed. we have to take care to generate teh right k-points from x if needed. if a user provides (4,4,4) we need to generate the MP grid, etc... Since i changed the MP code in set_kpts, there is some incompatibility with old jacapo calculations and their MP grids.... | def kpts_changed(calc, x): ''' check if kpt grid has changed. we have to take care to generate teh right k-points from x if needed. if a user provides (4,4,4) we need to generate the MP grid, etc... Since i changed the MP code in set_kpts, there is some incompatibility with old jacapo calculations and their MP grids.... | 454,677 |
def _line_search(self, func, myfprime, xk, pk, gfk, old_fval, old_old_fval, maxstep=.2, c1=.23, c2=0.46, xtrapl=1.1, xtrapu=4., stpmax=50, args=()): | def _line_search(self, func, myfprime, xk, pk, gfk, old_fval, old_old_fval, maxstep=.2, c1=.23, c2=0.46, xtrapl=1.1, xtrapu=4., stpmax=50, args=()): | 454,678 |
def _line_search(self, func, myfprime, xk, pk, gfk, old_fval, old_old_fval, maxstep=.2, c1=.23, c2=0.46, xtrapl=1.1, xtrapu=4., stpmax=50, args=()): | def _line_search(self, func, myfprime, xk, pk, gfk, old_fval, old_old_fval, maxstep=.2, c1=.23, c2=0.46, xtrapl=1.1, xtrapu=4., stpmax=50, args=()): | 454,679 |
def step(self, stp, f, g, c1, c2, xtol, isave, dsave): if self.task[:5] == 'START': | defstep(self,stp,f,g,c1,c2,xtol,isave,dsave):ifself.task[:5]=='START': | 454,680 |
def step(self, stp, f, g, c1, c2, xtol, isave, dsave): if self.task[:5] == 'START': | def step(self, stp, f, g, c1, c2, xtol, isave, dsave): if self.task[:5] == 'START': | 454,681 |
def update(self, stx, fx, gx, sty, fy, gy, stp, fp, gp, bracket, stpmin, stpmax): sign = gp * (gx / abs(gx)) | defupdate(self,stx,fx,gx,sty,fy,gy,stp,fp,gp,bracket,stpmin,stpmax):sign=gp*(gx/abs(gx)) | 454,682 |
def update(self, stx, fx, gx, sty, fy, gy, stp, fp, gp, bracket, stpmin, stpmax): sign = gp * (gx / abs(gx)) | defupdate(self,stx,fx,gx,sty,fy,gy,stp,fp,gp,bracket,stpmin,stpmax):sign=gp*(gx/abs(gx)) | 454,683 |
def determine_step(self, stp): dr = stp - self.old_stp if pymax(self.pk) * dr > self.maxstep: dr /= (pymax(self.pk) * dr / self.maxstep) stp = self.old_stp + dr return stp | def determine_step(self, stp): dr = stp - self.old_stp if abs(pymax(self.pk) * dr) > self.maxstep: dr /= abs((pymax(self.pk) * dr) / self.maxstep) stp = self.old_stp + dr return stp | 454,684 |
def read_aims_output(filename, index = -1): """ Import FHI-aims output files with all data available, i.e. relaxations, MD information, force information etc etc etc. """ from ase import Atoms, Atom from ase.calculators.singlepoint import SinglePointCalculator from ase.units import Ang, fs molecular_dynamics = False f... | def read_aims_output(filename, index = -1): """ Import FHI-aims output files with all data available, i.e. relaxations, MD information, force information etc etc etc. """ from ase import Atoms, Atom from ase.calculators.singlepoint import SinglePointCalculator from ase.units import Ang, fs molecular_dynamics = False f... | 454,685 |
def read_aims_output(filename, index = -1): """ Import FHI-aims output files with all data available, i.e. relaxations, MD information, force information etc etc etc. """ from ase import Atoms, Atom from ase.calculators.singlepoint import SinglePointCalculator from ase.units import Ang, fs molecular_dynamics = False f... | def read_aims_output(filename, index = -1): """ Import FHI-aims output files with all data available, i.e. relaxations, MD information, force information etc etc etc. """ from ase import Atoms, Atom from ase.calculators.singlepoint import SinglePointCalculator from ase.units import Ang, fs molecular_dynamics = False f... | 454,686 |
def open(self, button=None, filenames=None): if filenames == None: chooser = gtk.FileChooserDialog( _('Open ...'), None, gtk.FILE_CHOOSER_ACTION_OPEN, (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_OPEN, gtk.RESPONSE_OK)) ok = chooser.run() if ok == gtk.RESPONSE_OK: filenames = [chooser.get_filename()] chooser.destr... | def open(self, button=None, filenames=None): if filenames == None: chooser = gtk.FileChooserDialog( _('Open ...'), None, gtk.FILE_CHOOSER_ACTION_OPEN, (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_OPEN, gtk.RESPONSE_OK)) ok = chooser.run() == gtk.RESPONSE_OK if ok: filenames = [chooser.get_filename()] chooser.destr... | 454,687 |
def parprint(*args, **kwargs): """MPI save print - prints only from master. Tries to adopt python 3 behaviour. """ if rank > 0: return defaults = { 'end' : '\n', 'file' : sys.stdout } for key in defaults: if not key in kwargs: kwargs[key] = defaults[key] for arg in args[:-1]: print >> kwargs['file'], arg, if len(args... | def parprint(*args, **kwargs): """MPI-safe print - prints only from master. Tries to adopt python 3 behaviour. """ if rank > 0: return defaults = { 'end' : '\n', 'file' : sys.stdout } for key in defaults: if not key in kwargs: kwargs[key] = defaults[key] for arg in args[:-1]: print >> kwargs['file'], arg, if len(args... | 454,688 |
def parprint(*args, **kwargs): """MPI save print - prints only from master. Tries to adopt python 3 behaviour. """ if rank > 0: return defaults = { 'end' : '\n', 'file' : sys.stdout } for key in defaults: if not key in kwargs: kwargs[key] = defaults[key] for arg in args[:-1]: print >> kwargs['file'], arg, if len(args... | def parprint(*args, **kwargs): """MPI save print - prints only from master. Tries to adopt python 3 behaviour. """ if rank > 0: return defaults = {'end': '\n', 'file': sys.stdout } for key in defaults: if not key in kwargs: kwargs[key] = defaults[key] for arg in args[:-1]: print >> kwargs['file'], arg, if len(args): ... | 454,689 |
def summary(self, method='standard', direction='central'): hnu = self.get_energies(method, direction) s = 0.01 * units._e / units._c / units._hplanck parprint('-------------------------------------') parprint(' Mode Frequency Intensity') parprint(' # meV cm^-1 (D/Å)^2 amu^-1') parprint('------------... | def summary(self, method='standard', direction='central'): hnu = self.get_energies(method, direction) s = 0.01 * units._e / units._c / units._hplanck parprint('-------------------------------------') parprint(' Mode Frequency Intensity') parprint(' # meV cm^-1 (D/Å)^2 amu^-1') parprint('------------... | 454,690 |
def _set_frame_number(self, frame=None): '''set framenumber in the netcdf file | def _set_frame_number(self, frame=None): '''set framenumber in the netcdf file | 454,691 |
def _set_frame_number(self, frame=None): '''set framenumber in the netcdf file | def _set_frame_number(self, frame=None): '''set framenumber in the netcdf file | 454,692 |
def _set_external_dipole(self,x): if x is not None: self.set_external_dipole(**x) | def _set_external_dipole(self,x): if x is not None and isinstance(x,dict): self.set_external_dipole(**x) | 454,693 |
def set_external_dipole(self, value, position=None): ''' Externally imposed dipole potential. This option overwrites DipoleCorrection if set. | def set_external_dipole(self, value, position=None): ''' Externally imposed dipole potential. This option overwrites DipoleCorrection if set. | 454,694 |
def cut(atoms, a=(1,0,0), b=(0,1,0), c=(0,0,1), origo=(0,0,0), nlayers=None, extend=1.0, tolerance=0.001): """Cuts out a cell defined by *a*, *b*, *c* and *origo* from a sufficiently repeated copy of *atoms*. Typically, this function is used to create slabs of different sizes and orientations. The vectors *a*, *b* and... | def cut(atoms, a=(1,0,0), b=(0,1,0), c=(0,0,1), origo=(0,0,0), nlayers=None, extend=1.0, tolerance=0.001): """Cuts out a cell defined by *a*, *b*, *c* and *origo* from a sufficiently repeated copy of *atoms*. Typically, this function is used to create slabs of different sizes and orientations. The vectors *a*, *b* and... | 454,695 |
def __init__(self, label='dftb', write_dftb=False, charge=0.0, include_dispersion=False, do_spin_polarized=False, unpaired_electrons=0.0, fermi_temperature=0.0, scc=False): """Construct DFTB-calculator object. | def __init__(self, label='dftb', write_dftb=False, charge=0.0, include_dispersion=False, do_spin_polarized=False, unpaired_electrons=0.0, fermi_temperature=0.0, scc=False): """Construct DFTB-calculator object. | 454,696 |
def equivalent_sites(self, scaled_positions, ondublicates='error', symprec=1e-3): """Returns the scaled positions and all their equivalent sites. | def equivalent_sites(self, scaled_positions, ondublicates='error', symprec=1e-3): """Returns the scaled positions and all their equivalent sites. | 454,697 |
def equivalent_sites(self, scaled_positions, ondublicates='error', symprec=1e-3): """Returns the scaled positions and all their equivalent sites. | def equivalent_sites(self, scaled_positions, ondublicates='error', symprec=1e-3): """Returns the scaled positions and all their equivalent sites. | 454,698 |
def equivalent_sites(self, scaled_positions, ondublicates='error', symprec=1e-3): """Returns the scaled positions and all their equivalent sites. | def equivalent_sites(self, scaled_positions, ondublicates='error', symprec=1e-3): """Returns the scaled positions and all their equivalent sites. | 454,699 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.