inwonyeu / interphon Goto Github PK
View Code? Open in Web Editor NEWInterfacial Phonon code
License: GNU Lesser General Public License v2.1
Interfacial Phonon code
License: GNU Lesser General Public License v2.1
Dear In Won Yeu,
During the use of your software I faced with another problem. If I try to sequentially initialize two instances of PreProcess with different POSCARS that have different number of atoms, I get the following error:
ValueError Traceback (most recent call last)
Input In [3], in <cell line: 15>()
13 pre.set_user_arg(user_args)
14 pre.set_unit_cell(path_us_2)
---> 15 pre.set_super_cell(path_ss_2)
File ~\PycharmProjects\interphon\InterPhon\core\pre_process.py:109, in PreProcess.set_super_cell(self, out_file, comment, write_file, code_name)
93 def set_super_cell(self, out_file: FilePath,
94 comment: str = 'Supercell',
95 write_file: bool = True,
96 code_name: str = 'vasp') -> File:
97 """
98 Set a SuperCell instance from the information stored in its UnitCell and UserArgument instances.
99
(...)
107 :type code_name: str
108 """
--> 109 self.super_cell.set_super_cell(self.unit_cell, self.user_arg)
110 self.super_cell.set_super_ind_true(self.unit_cell, self.user_arg)
111 if write_file is True:
File ~\PycharmProjects\interphon\InterPhon\core\super_cell.py:72, in SuperCell.set_super_cell(self, unit_cell, user_arg)
69 if value:
70 _enlarge = _enlarge * user_arg.enlargement[ind]
---> 72 self.atom_type = []
73 for atom_type in unit_cell.atom_type:
74 self.atom_type.extend([atom_type for _ in range(_enlarge)])
File ~\PycharmProjects\interphon\InterPhon\core\unit_cell.py:119, in UnitCell.atom_type(self, _atom_type)
117 self.__atom_type = _atom_type
118 else:
--> 119 raise ValueError("The length of atom_type should be the total number of atoms")
ValueError: The length of atom_type should be the total number of atoms
How to reproduce:
Just run the following code where (path_us_1, path_ss_1) and (path_us_2, path_ss_2) are the paths to the Unitcell/Supercell having different number of atoms. I used a Jupyter Notebook, python 3.9.
from InterPhon.core import PreProcess
user_args = {'dft_code': 'vasp',
'displacement': 0.05,
'enlargement': "1 1 1",
'periodicity': "1 1 0"}
pre = PreProcess()
pre.set_user_arg(user_args)
pre.set_unit_cell(path_us_1)
pre.set_super_cell(path_ss_1)
pre = PreProcess()
pre.set_user_arg(user_args)
pre.set_unit_cell(path_us_1)
pre.set_super_cell(path_ss_2)
Hallo,
THank you for providing the code. Is there in future a plan to release for 3D system. When I do for bulk system it says it has not been implemented.
Also, one question in this code at T=0 the code calculates ZPE. Is that right? ZPE= 1/2 * h_bar * (sum over all positive frequencies))
Thanks,
Asif
Dear In Won Yeu,
If I try to create POSCAR files with atom displacements with any 'periodicity' tag except '1 1 0' (for instance, '1 1 1') the program fails with an error:
File InterPhon\core\pre_process.py:139, in PreProcess.write_displace_cell(self, out_file, code_name, sym_flag)
137 if sym_flag:
138 self.sym = Symmetry2D(self.unit_cell, self.super_cell, self.user_arg)
--> 139 _, _, _ = self.sym.search_point_group()
140 except error.Cannot_Search_Point_Group as e:
141 print("look-up table: ", e.value)
File InterPhon\util\symmetry.py:151, in Symmetry2D.search_point_group(self)
149 rot_ind = []
150 for ind, rot in enumerate(W_candidate):
--> 151 G_rotate = np.dot(np.transpose(rot), np.dot(G_metric, rot))
152 if np.allclose(G_metric, G_rotate, atol=1e-06):
153 rot_ind.append(ind)
File <array_function internals>:180, in dot(*args, **kwargs)
ValueError: shapes (3,3) and (2,2) not aligned: 3 (dim 1) != 2 (dim 0)
Is it expected that InterPhon can operate only with 2D PBC?
Thank you in advance.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.