Skip to content

Commit

Permalink
Merge pull request #5343 from kayahans/debug/tiling
Browse files Browse the repository at this point in the history
Nexus: Better handling tiling matrix
  • Loading branch information
ye-luo authored Feb 27, 2025
2 parents 98ab9a5 + 32fa9a8 commit 3be33a3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion nexus/lib/physical_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -735,8 +735,15 @@ def generate_physical_system(**kwargs):
pre.remove_folded_structure()
structure = pre.tile(tiling)
#end if
if isinstance(tiling, tuple):
tiling_mat = np.diag(tiling)
elif tiling is None:
tiling_mat = np.eye(3)
else:
tiling_mat = tiling

if tiling!=None and tiling!=(1,1,1) and structure.has_folded():
if not np.array_equal(tiling_mat, np.eye(3)) and structure.has_folded():
# Has some supercell tiling
fps = PhysicalSystem(
structure = structure.folded_structure,
net_charge = net_charge,
Expand Down Expand Up @@ -764,6 +771,7 @@ def generate_physical_system(**kwargs):
structure.set_folded(folded_structure)
ps.folded_system = fps
else:
# No supercell tiling
ps = PhysicalSystem(
structure = structure,
net_charge = net_charge,
Expand Down

0 comments on commit 3be33a3

Please sign in to comment.