@@ -56,29 +56,70 @@ def fe_fcc_state(device: torch.device) -> Any:
56
56
return atoms_to_state (fe_atoms , device , torch .float64 )
57
57
58
58
59
- @pytest .fixture
60
- def ar_fcc_state (device : torch .device ) -> Any :
61
- ar_atoms = bulk ("Ar" , "fcc" , a = 5.26 , cubic = True ).repeat ([4 , 4 , 4 ])
62
- return atoms_to_state (ar_atoms , device , torch .float64 )
63
-
64
-
65
59
@pytest .fixture
66
60
def si_double_base_state (si_atoms : Atoms , device : torch .device ) -> Any :
67
61
"""Create a basic state from si_structure."""
68
62
return atoms_to_state ([si_atoms , si_atoms ], device , torch .float64 )
69
63
70
64
65
+ @pytest .fixture
66
+ def ar_fcc_base_state (device : torch .device ) -> BaseState :
67
+ """Create a face-centered cubic (FCC) Argon structure."""
68
+ # 5.26 Å is a typical lattice constant for Ar
69
+ a = 5.26 # Lattice constant
70
+ N = 4 # Supercell size
71
+ n_atoms = 4 * N * N * N # Total number of atoms (4 atoms per unit cell)
72
+ dtype = torch .float64
73
+
74
+ # Create positions tensor directly
75
+ positions = torch .zeros ((n_atoms , 3 ), device = device , dtype = dtype )
76
+ idx = 0
77
+ for i in range (N ):
78
+ for j in range (N ):
79
+ for k in range (N ):
80
+ # Add base FCC positions with offset
81
+ positions [idx ] = torch .tensor ([i , j , k ], device = device , dtype = dtype ) * a
82
+ positions [idx + 1 ] = (
83
+ torch .tensor ([i , j + 0.5 , k + 0.5 ], device = device , dtype = dtype ) * a
84
+ )
85
+ positions [idx + 2 ] = (
86
+ torch .tensor ([i + 0.5 , j , k + 0.5 ], device = device , dtype = dtype ) * a
87
+ )
88
+ positions [idx + 3 ] = (
89
+ torch .tensor ([i + 0.5 , j + 0.5 , k ], device = device , dtype = dtype ) * a
90
+ )
91
+ idx += 4
92
+
93
+ # Create cell tensor with shape (1, 3, 3) to match atoms_to_state format
94
+ cell = torch .eye (3 , device = device , dtype = dtype ).unsqueeze (0 ) * (N * a )
95
+
96
+ # Create batch indices
97
+ batch = torch .zeros (n_atoms , device = device , dtype = torch .long )
98
+
99
+ return BaseState (
100
+ positions = positions ,
101
+ masses = torch .full ((n_atoms ,), 39.95 , device = device , dtype = dtype ), # Ar mass
102
+ cell = cell , # Cubic cell
103
+ pbc = True ,
104
+ atomic_numbers = torch .full (
105
+ (n_atoms ,), 18 , device = device , dtype = torch .long
106
+ ), # Ar atomic number
107
+ batch = batch ,
108
+ )
109
+
110
+
71
111
@pytest .fixture
72
112
def unbatched_lj_calculator (device : torch .device ) -> UnbatchedLennardJonesModel :
73
- """Create a Lennard-Jones calculator with reasonable parameters for Si ."""
113
+ """Create a Lennard-Jones calculator with reasonable parameters for Ar ."""
74
114
return UnbatchedLennardJonesModel (
75
- sigma = 2.0 , # Approximate for Si-Si interaction
76
- epsilon = 0.1 , # Small epsilon for stability during testing
115
+ use_neighbor_list = True ,
116
+ sigma = 3.405 , # Approximate for Ar-Ar interaction
117
+ epsilon = 0.0104 , # Small epsilon for stability during testing
77
118
device = device ,
78
119
dtype = torch .float64 ,
79
120
compute_force = True ,
80
121
compute_stress = True ,
81
- cutoff = 5.0 ,
122
+ cutoff = 2.5 * 3.405 ,
82
123
)
83
124
84
125
0 commit comments