Skip to content

Commit

Permalink
Merge branch 'release-1.10.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
atztogo committed Jan 25, 2016
2 parents 3dd79ee + f24b7a3 commit dd32e81
Show file tree
Hide file tree
Showing 125 changed files with 1,107 additions and 2,507 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
[![Binstar Badge](https://anaconda.org/jochym/phonopy/badges/version.svg)](https://binstar.org/jochym/phonopy)
[![Binstar Badge](https://anaconda.org/jochym/phonopy/badges/installer/conda.svg)](https://anaconda.org/jochym/phonopy)
[![Binstar Badge](https://anaconda.org/jochym/phonopy/badges/build.svg)](https://anaconda.org/jochym/phonopy/builds)

phonopy
=======

Phonon code
For the details, see https://atztogo.github.io/phonopy/
Phonon code. For the details, see https://atztogo.github.io/phonopy/
3 changes: 2 additions & 1 deletion anharmonic/other/isotope.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ def _allocate_phonon(self):
num_grid = len(self._grid_address)
self._phonon_done = np.zeros(num_grid, dtype='byte')
self._frequencies = np.zeros((num_grid, num_band), dtype='double')
itemsize = self._frequencies.itemsize
self._eigenvectors = np.zeros((num_grid, num_band, num_band),
dtype='complex128')
dtype=("c%d" % (itemsize * 2)))

24 changes: 18 additions & 6 deletions anharmonic/phonon3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def __init__(self,
masses=None,
mesh=None,
band_indices=None,
sigmas=[],
sigmas=None,
cutoff_frequency=1e-4,
frequency_factor_to_THz=VaspToTHz,
is_symmetry=True,
Expand All @@ -40,6 +40,8 @@ def __init__(self,
symprec=1e-5,
log_level=0,
lapack_zheev_uplo='L'):
if sigmas is None:
sigmas = []
self._symprec = symprec
self._sigmas = sigmas
self._frequency_factor_to_THz = frequency_factor_to_THz
Expand Down Expand Up @@ -329,10 +331,12 @@ def run_imag_self_energy(self,
grid_points,
frequency_step=None,
num_frequency_points=None,
temperatures=[0.0, 300.0],
temperatures=None,
scattering_event_class=None,
run_with_g=True,
write_details=False):
if temperatures is None:
temperatures = [0.0, 300.0]
self._grid_points = grid_points
self._temperatures = temperatures
self._scattering_event_class = scattering_event_class
Expand Down Expand Up @@ -388,7 +392,7 @@ def run_thermal_conductivity(
self,
is_LBTE=True,
temperatures=np.arange(0, 1001, 10, dtype='double'),
sigmas=[],
sigmas=None,
is_isotope=False,
mass_variances=None,
grid_points=None,
Expand All @@ -411,6 +415,8 @@ def run_thermal_conductivity(
input_filename=None,
output_filename=None):

if sigmas is None:
sigmas = []
if is_LBTE:
self._thermal_conductivity = get_thermal_conductivity_LBTE(
self._interaction,
Expand Down Expand Up @@ -458,9 +464,11 @@ def get_thermal_conductivity(self):

def get_frequency_shift(self,
grid_points,
epsilons=[0.1],
epsilons=None,
temperatures=np.arange(0, 1001, 10, dtype='double'),
output_filename=None):
if epsilons is None:
epsilons = [0.1]
self._grid_points = grid_points
get_frequency_shift(self._interaction,
self._grid_points,
Expand Down Expand Up @@ -628,11 +636,13 @@ def __init__(self,
primitive,
mass_variances=None, # length of list is num_atom.
band_indices=None,
sigmas=[],
sigmas=None,
frequency_factor_to_THz=VaspToTHz,
symprec=1e-5,
cutoff_frequency=None,
lapack_zheev_uplo='L'):
if sigmas is None:
sigmas = []
self._mesh = mesh
self._sigmas = sigmas
self._iso = Isotope(mesh,
Expand Down Expand Up @@ -701,7 +711,7 @@ def __init__(self,
fc2,
nac_params=None,
nac_q_direction=None,
sigmas=[],
sigmas=None,
cutoff_frequency=1e-4,
frequency_step=None,
num_frequency_points=None,
Expand All @@ -712,6 +722,8 @@ def __init__(self,
symprec=1e-5,
output_filename=None,
log_level=0):
if sigmas is None:
sigmas = []
self._supercell = supercell
self._primitive = primitive
self._mesh = mesh
Expand Down
4 changes: 3 additions & 1 deletion anharmonic/phonon3/conductivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def __init__(self,
symmetry,
grid_points=None,
temperatures=None,
sigmas=[],
sigmas=None,
is_isotope=False,
mass_variances=None,
mesh_divisors=None,
Expand All @@ -23,6 +23,8 @@ def __init__(self,
no_kappa_stars=False,
gv_delta_q=None, # finite difference for group veolocity
log_level=0):
if sigmas is None:
sigmas = []
self._pp = interaction
self._collision = None # has to be set derived class

Expand Down
8 changes: 6 additions & 2 deletions anharmonic/phonon3/conductivity_LBTE.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def get_thermal_conductivity_LBTE(
interaction,
symmetry,
temperatures=np.arange(0, 1001, 10, dtype='double'),
sigmas=[],
sigmas=None,
is_isotope=False,
mass_variances=None,
grid_points=None,
Expand All @@ -31,6 +31,8 @@ def get_thermal_conductivity_LBTE(
output_filename=None,
log_level=0):

if sigmas is None:
sigmas = []
if log_level:
print("-------------------- Lattice thermal conducitivity (LBTE) "
"--------------------")
Expand Down Expand Up @@ -249,7 +251,7 @@ def __init__(self,
symmetry,
grid_points=None,
temperatures=None,
sigmas=[],
sigmas=None,
is_isotope=False,
mass_variances=None,
boundary_mfp=None, # in micrometre
Expand All @@ -258,6 +260,8 @@ def __init__(self,
gv_delta_q=None, # finite difference for group veolocity
pinv_cutoff=1.0e-8,
log_level=0):
if sigmas is None:
sigmas = []
self._pp = None
self._temperatures = None
self._sigmas = None
Expand Down
8 changes: 6 additions & 2 deletions anharmonic/phonon3/conductivity_RTA.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def get_thermal_conductivity_RTA(
interaction,
symmetry,
temperatures=np.arange(0, 1001, 10, dtype='double'),
sigmas=[],
sigmas=None,
mass_variances=None,
grid_points=None,
is_isotope=False,
Expand All @@ -29,6 +29,8 @@ def get_thermal_conductivity_RTA(
output_filename=None,
log_level=0):

if sigmas is None:
sigmas = []
if log_level:
print("-------------------- Lattice thermal conducitivity (RTA) "
"--------------------")
Expand Down Expand Up @@ -299,7 +301,7 @@ def __init__(self,
symmetry,
grid_points=None,
temperatures=np.arange(0, 1001, 10, dtype='double'),
sigmas=[],
sigmas=None,
is_isotope=False,
mass_variances=None,
boundary_mfp=None, # in micrometre
Expand All @@ -312,6 +314,8 @@ def __init__(self,
run_with_g=True,
log_level=0):

if sigmas is None:
sigmas = []
self._pp = None
self._temperatures = None
self._sigmas = None
Expand Down
4 changes: 3 additions & 1 deletion anharmonic/phonon3/frequency_shift.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ def get_frequency_shift(interaction,
grid_points,
band_indices,
epsilons,
temperatures=[0.0, 300.0],
temperatures=None,
output_filename=None,
log_level=0):
if temperatures is None:
temperatures = [0.0, 300.0]
fst = FrequencyShift(interaction)
band_indices_flatten = interaction.get_band_indices()
mesh = interaction.get_mesh_numbers()
Expand Down
4 changes: 3 additions & 1 deletion anharmonic/phonon3/imag_self_energy.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def get_imag_self_energy(interaction,
sigmas,
frequency_step=None,
num_frequency_points=None,
temperatures=[0.0, 300.0],
temperatures=None,
scattering_event_class=None, # class 1 or 2
run_with_g=True,
write_details=False,
Expand Down Expand Up @@ -44,6 +44,8 @@ def get_imag_self_energy(interaction,
Tuple: (Imaginary part of self energy, sampling frequency points)
"""
if temperatures is None:
temperatures = [0.0, 300.0]

if temperatures is None:
print("Temperatures have to be set.")
Expand Down
4 changes: 2 additions & 2 deletions anharmonic/phonon3/interaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,6 @@ def _allocate_phonon(self):
num_grid = len(self._grid_address)
self._phonon_done = np.zeros(num_grid, dtype='byte')
self._frequencies = np.zeros((num_grid, num_band), dtype='double')
itemsize = self._frequencies.itemsize
self._eigenvectors = np.zeros((num_grid, num_band, num_band),
dtype='complex128')

dtype=("c%d" % (itemsize * 2)))
3 changes: 2 additions & 1 deletion anharmonic/phonon3/joint_dos.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,9 @@ def set_grid_point(self, grid_point):
if self._phonon_done is None:
self._phonon_done = np.zeros(num_grid, dtype='byte')
self._frequencies = np.zeros((num_grid, num_band), dtype='double')
itemsize = self._frequencies.itemsize
self._eigenvectors = np.zeros((num_grid, num_band, num_band),
dtype='complex128')
dtype=("c%d" % (itemsize * 2)))

self._joint_dos = None
self._frequency_points = None
Expand Down
16 changes: 12 additions & 4 deletions anharmonic/phonon3/triplets.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ def invert_grid_point(grid_point, mesh, grid_address, bz_map):
address = grid_address[grid_point]
return get_bz_grid_point_from_address(-address, mesh, bz_map)

def get_ir_grid_points(mesh, rotations, mesh_shifts=[False, False, False]):
def get_ir_grid_points(mesh, rotations, mesh_shifts=None):
if mesh_shifts is None:
mesh_shifts = [False, False, False]
grid_mapping_table, grid_address = spg.get_stabilized_reciprocal_mesh(
mesh,
rotations,
Expand All @@ -136,7 +138,9 @@ def get_ir_grid_points(mesh, rotations, mesh_shifts=[False, False, False]):
def get_grid_points_by_rotations(grid_point,
reciprocal_rotations,
mesh,
mesh_shifts=[False, False, False]):
mesh_shifts=None):
if mesh_shifts is None:
mesh_shifts = [False, False, False]
return spg.get_grid_points_by_rotations(
grid_point,
reciprocal_rotations,
Expand All @@ -147,7 +151,9 @@ def get_BZ_grid_points_by_rotations(grid_point,
reciprocal_rotations,
mesh,
bz_map,
mesh_shifts=[False, False, False]):
mesh_shifts=None):
if mesh_shifts is None:
mesh_shifts = [False, False, False]
return spg.get_BZ_grid_points_by_rotations(
grid_point,
reciprocal_rotations,
Expand Down Expand Up @@ -186,7 +192,9 @@ def from_coarse_to_dense_grid_points(dense_mesh,
mesh_divisors,
coarse_grid_points,
coarse_grid_address,
coarse_mesh_shifts=[False, False, False]):
coarse_mesh_shifts=None):
if coarse_mesh_shifts is None:
coarse_mesh_shifts = [False, False, False]
shifts = np.where(coarse_mesh_shifts, 1, 0)
dense_grid_points = []
for cga in coarse_grid_address[coarse_grid_points]:
Expand Down
Loading

0 comments on commit dd32e81

Please sign in to comment.