Skip to content

Commit c936ed3

Browse files
committed
Restore to_cell implementation
1 parent b9d201f commit c936ed3

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

pyscf/gto/mole.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3855,7 +3855,8 @@ def to_cell(self, box=None, dimension=None, margin=None):
38553855
of the box.
38563856
'''
38573857
from pyscf.pbc.gto import Cell, rcut_by_shells
3858-
cell = self.view(Cell)
3858+
cell = Cell()
3859+
cell.__dict__.update(self.__dict__)
38593860
if box is None:
38603861
# Place molecule in a big box for dimension=0
38613862
dimension = 0

pyscf/pbc/gto/cell.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,6 +1210,18 @@ class Cell(mole.MoleBase):
12101210
precision = getattr(__config__, 'pbc_gto_cell_Cell_precision', 1e-8)
12111211
exp_to_discard = getattr(__config__, 'pbc_gto_cell_Cell_exp_to_discard', None)
12121212

1213+
fractional = False
1214+
dimension = 3
1215+
# TODO: Simple hack for now; the implementation of ewald depends on the
1216+
# density-fitting class. This determines how the ewald produces
1217+
# its energy.
1218+
low_dim_ft_type = None
1219+
use_loose_rcut = False
1220+
use_particle_mesh_ewald = False
1221+
space_group_symmetry = False
1222+
symmorphic = False
1223+
lattice_symmetry = None
1224+
12131225
_keys = {
12141226
'precision', 'exp_to_discard',
12151227
'a', 'ke_cutoff', 'pseudo', 'fractional', 'dimension', 'low_dim_ft_type',
@@ -1227,18 +1239,6 @@ def __init__(self, **kwargs):
12271239
# of fourier components, with .5 * G**2 < ke_cutoff
12281240
self.ke_cutoff = None
12291241

1230-
self.fractional = False
1231-
self.dimension = 3
1232-
# TODO: Simple hack for now; the implementation of ewald depends on the
1233-
# density-fitting class. This determines how the ewald produces
1234-
# its energy.
1235-
self.low_dim_ft_type = None
1236-
self.use_loose_rcut = False
1237-
self.use_particle_mesh_ewald = False
1238-
self.space_group_symmetry = False
1239-
self.symmorphic = False
1240-
self.lattice_symmetry = None
1241-
12421242
##################################################
12431243
# These attributes are initialized by build function if not specified
12441244
self.mesh = None

0 commit comments

Comments
 (0)