Guide · VASP · LAMMPS · 11 min read
How do I build a supercell, and how should the k-points change with it?
Checked against the docs · VASP wiki and LAMMPS stable release 30 Sep 2026 update 1 · Last checked 12 November 2026 · Spot a mistake? Tell us
Short answer
Repeat the cell n1 × n2 × n3 times by multiplying each lattice vector and placing a copy of every atom in each repeat, keeping each species' atoms together in POSCAR; in LAMMPS, use replicate or a bigger region before create_atoms. Divide the k-point subdivisions along each direction by the same factor, as the VASP wiki does for silicon (a 12×12×12 mesh for the primitive cell, 6×6×6 for a 2×2×2 supercell), or set KSPACING and let VASP work the mesh out.
What is a supercell?
A crystal is described by a cell: three lattice vectors that repeat forever, and the atoms inside. The smallest cell that does this is the primitive cell. A supercell is a bigger cell made by repeating a smaller one: n1 times along the first lattice vector, n2 times along the second and n3 times along the third. A 2×2×2 supercell has eight times the atoms and eight times the volume of the cell it was built from, and describes exactly the same perfect crystal.
In VASP the cell lives in POSCAR: a scaling factor, three lattice vectors, the species and how many atoms of each, then one line per atom. In LAMMPS the box is created by commands in the input script, or read from a data file.
When do I need a supercell?
For a phonon calculation by finite differences. The VASP wiki's phonon page says that an accurate phonon dispersion needs the force constants computed in a large enough supercell.
For a defect. A cell is repeated periodically, so a defect placed in it is repeated in every copy. The wiki's page on dipole corrections for defects describes the spurious interactions between a defect and its copies in the neighboring supercells: electrostatic ones for charged defects, and elastic ones that the page says fall off as 1/L³, where L is the size of the supercell. A bigger supercell puts the copies further apart. See How do I make a point defect?
For a surface. A slab is a supercell with layers stacked along one direction and vacuum added. See How do I build a surface slab?
How do I build a supercell for VASP?
- Multiply each lattice vector by its repeat count. For a 2×2×2 supercell, every component of all three vectors doubles. Keep the scaling factor on the second line as it was; the
POSCARpage explains that the actual lattice vectors are the given numbers times that factor. - Place a copy of every atom in every repeat. In direct (fractional) coordinates, an atom at x in the old cell sits at (x + i)/n in the new one, for i = 0 to n − 1 along each direction.
- Keep each species together and update the counts. The
POSCARpage says the atom lines must follow the "Ions per species" line: all atoms of the first species, then all of the second. Multiply each count by n1 × n2 × n3, and keep the species in the same order as inPOTCAR. - Write enough digits. VASP finds the symmetry from
POSCAR, and the wiki strongly recommends positions and lattice vectors with at least 7 significant digits; it calls 5 "absolutely borderline".
For example, the wiki's fcc silicon tutorial uses a one-atom primitive cell. Doubled along all three vectors it becomes this eight-atom POSCAR (an example built by hand from the tutorial's cell, not a file from the wiki):
fcc Si, 2x2x2 supercell (example)
3.9
1.0000000 1.0000000 0.0000000
0.0000000 1.0000000 1.0000000
1.0000000 0.0000000 1.0000000
Si
8
Direct
0.0000000 0.0000000 0.0000000
0.5000000 0.0000000 0.0000000
0.0000000 0.5000000 0.0000000
0.0000000 0.0000000 0.5000000
0.5000000 0.5000000 0.0000000
0.5000000 0.0000000 0.5000000
0.0000000 0.5000000 0.5000000
0.5000000 0.5000000 0.5000000The scaling factor (3.9) is the tutorial's lattice constant; the vectors are the tutorial's 0.5 0.5 0.0, 0.0 0.5 0.5 and 0.5 0.0 0.5, doubled; the one atom at the origin now appears at every combination of 0 and 0.5.
If your POSCAR has a Selective dynamics line, every copy of an atom needs the same T or F flags as the original.
How should the k-points change?
Divide the subdivisions by the repeat count. The k-point mesh samples the Brillouin zone (the space of electron wave directions; see What are k-points?). A bigger cell has a smaller Brillouin zone, so it needs fewer k-points for the same sampling. The VASP wiki gives a worked example on its phonon page: the primitive cell of silicon needs a 12×12×12 Γ-centered mesh, and "when replicating the unit cell to a 2x2x2 supercell, a 6x6x6 k point mesh will produce an equivalent sampling. For a 4x4x4 supercell, a 3x3x3 k point mesh will suffice."
| Primitive cell mesh | Supercell | Supercell mesh |
|---|---|---|
| 12×12×12 | 2×2×2 | 6×6×6 |
| 12×12×12 | 4×4×4 | 3×3×3 |
| N1×N2×N3 | n1×n2×n3 | N1/n1 × N2/n2 × N3/n3 |
The first two rows are the wiki's; the third is the same rule written out. When the division does not come out whole (a 9×9×9 mesh in a 2×2×2 supercell), the wiki does not say what to do; pick a whole number near it and test convergence on the supercell itself. The wiki's example uses a Γ-centered mesh, and it does not say whether the same rule holds for a Monkhorst-Pack mesh with an even number of subdivisions, which is shifted; with such a mesh, test the supercell's convergence directly.
This follows the KPOINTS page's general rule: choose the number of points along each direction roughly inversely proportional to the length of the cell along it.
Or let VASP work it out with KSPACING. If there is no KPOINTS file, VASP builds the mesh from the KSPACING tag: along each reciprocal lattice vector bᵢ it uses Nᵢ = max(1, ceiling(|bᵢ| 2π / KSPACING)) points. Doubling a cell edge halves the length of the matching reciprocal vector, so the mesh shrinks with the cell on its own, rounded up. The two pages differ on when to use it: the KPOINTS page suggests KSPACING for a quick first run and a regular mesh you write yourself for production; the KSPACING page recommends it over the fully automatic mode inside a KPOINTS file.
Large supercells. For a big simple-cubic supercell, a regular mesh jumps from 1 k-point (Γ alone) straight to 8 (2×2×2). The KPOINTS page shows generalized meshes with 2 or 4 k-points in between, which keep the full cubic symmetry.
What it depends on:
- The mesh you converged for the small cell. Scale that one, not a guess. See How do I test convergence?
- The lattice type. The KPOINTS page lists which mesh types each Bravais lattice allows: only Γ-centered meshes for face-centered cubic cells, for example. A supercell can have a different lattice type from the cell it came from, so check the table for the new cell.
- What you will compare. If you will subtract the supercell's energy from the small cell's (or from another supercell's), scaling the mesh keeps the sampling the same in both.
How do I build a supercell in LAMMPS?
From a lattice, make the box bigger. The lattice command defines a unit cell and its basis atoms; region and create_box make the box, and create_atoms fills it. Lengths in region are in lattice spacings unless you say otherwise, so the box size is the repeat count:
units metal
lattice fcc 3.52
region box block 0 4 0 4 0 4
create_box 1 box
create_atoms 1 boxlattice fcc 3.52 is the manual's own example: with metal units it is a cubic cell 3.52 Å on a side, with the 4 basis atoms of an fcc lattice. The block from 0 to 4 in each direction makes a 4×4×4 repeat of that cubic cell, so create_atoms places 4 × 64 = 256 atoms. The create_atoms page warns that a periodic box should be a whole number of lattice spacings, to avoid atoms overlapping at the box boundaries.
From atoms you already have, use replicate. After reading a data file, replicate 2 2 2 doubles the box in each direction and makes 8 times as many atoms, with new atom ids. The replicate page lists what to watch:
- It copies everything about each atom, velocities included, "which may or may not be desirable".
- It cannot copy per-atom data held by fixes; define such fixes after replicating (the page gives two workarounds for a restart file).
- In a non-periodic direction, replicating can put atoms nearly on top of each other.
- For bonded models with a chain of bonds that crosses the whole box and joins itself, use the
bond/periodickeyword; without it the replicated bonds are invalid.
There is no k-point mesh to scale in a LAMMPS input.
How do I check the supercell?
Count the atoms. The new cell should hold exactly n1 × n2 × n3 times the old number of each species. In LAMMPS, a box filled from a lattice should hold the lattice's basis atoms (4 for fcc, 8 for diamond, as the lattice page lists them) times the number of cells. LAMMPS writes the count to the screen and to log.lammps: create_atoms prints Created 4000 atoms (the number it added), and replicate prints Replication is creating a 2x2x2 = 8 times larger system... followed, further down, by the new total, such as 32000 atoms (the numbers here are examples). To find them:
grep -E "^Created [0-9]+ atoms|^Replication is creating|^ [0-9]+ atoms$" log.lammpsThe last pattern also matches the atom count read_data reports, so read each match in its place in the log.
Read VASP's symmetry analysis. With symmetry on, VASP writes to OUTCAR the Bravais lattice and space group it found for the supercell and, for a supercell that is not primitive, the type of the primitive cell that generates it. If that is not the crystal you meant to build, an atom is misplaced or the digits are too few.
Check the positions VASP read. The POSCAR page suggests checking OUTCAR, which lists every position both in Cartesian and in direct coordinates.
Compare one energy. A perfect supercell with the scaled mesh describes the same crystal as the small cell, so its energy per atom should come out close to the small cell's. The wiki gives no tolerance for how close; small differences can come from the FFT grids and from the symmetry differences described next.
Do not expect perfect symmetry. The ISYM page says VASP does not find the symmetry elements of the primitive cell inside a supercell, and that the automatic k-point mesh usually lacks them too, so forces that should be zero by symmetry will not be exactly zero.
What goes wrong with supercells?
| Mistake | What you would see | What to do |
|---|---|---|
| Keeping the primitive cell's k-point mesh in the supercell | A run many times slower than it needs to be, with no gain in accuracy | Divide each subdivision by the repeat count along it, or use KSPACING. |
Atoms of one species split into several groups in POSCAR | Species assigned to the wrong atoms: VASP reads them by the counts line, in POTCAR order | Keep each species' atoms together, in the same order as POTCAR. |
| Too few digits in the positions | VASP finds only part of the symmetry, or a lower one than the crystal has | Write at least 7 significant digits, as the POSCAR page recommends. |
| A periodic LAMMPS box that is not a whole number of lattice spacings | Atoms overlapping at the box boundary | Make the region a whole number of lattice spacings in each direction. |
replicate on a system that already has velocities | Every copy moves the same way, as the page warns | Assign velocities after replicating, if that is what you want. |
In Build, the Supercell tool repeats the cell along a, b and c for a VASP or a LAMMPS run, and the POSCAR or data.lammps tab under Files shows the result. When the k-points are set by a spacing, Verlet works the mesh out again for the new cell; if you set the mesh yourself, divide it as above. Everything above works without it.