4. Your first project
Let’s run a real calculation end to end: the band structure and density of states of silicon. The same example is worked through in Silicon: SCF, band structure & DOS; here we follow what actually happens on screen the first time you use LatticeMind.
Before you begin
You need LatticeMind installed, the LatticeMind license in place
(The LatticeMind license), and a model provider configured — latticemind setup
asks for it and for the RESCU path, or see Connecting your AI model.
To run the calculation you also need the RESCU executable and a RESCU
license. Without them you can still build the structure, write the inputs and
inspect them.
4.1. Step 1 — Make a folder and start in it
The folder you start LatticeMind in is the project. Make an empty one, change into it, and start:
mkdir silicon-bands
cd silicon-bands
latticemind
LatticeMind creates a hidden .latticemind/ folder there for its own records
and writes everything else — the solver inputs, pseudopotentials/,
results/ and the figures — straight into that folder.
Pick a folder of your own. Your home directory, the filesystem root, and system or software directories are declined with a short message asking you to change into a project folder first, so a mistyped path cannot scatter files across your machine.
The greeting names the project folder and the model. To use a different model,
type /model and pick one from the list; an unconfigured one asks for its API
key and saves it (see Interactive commands).
4.2. Step 2 — Say what you want, in one sentence
Type your request in plain language and press Enter:
Do an SCF, band structure and DOS calculation for silicon, and plot the
band structure and DOS.
LatticeMind looks at what is in the folder, builds the silicon structure, chooses the parameters, and writes and checks the RESCU inputs.
4.3. Step 3 — Watch it work
Two lines stay at the bottom of the screen and update in place. The first shows
the elapsed time, what LatticeMind is doing right now, and a reminder that
ctrl-c stops it. The second, marked >, is where you type: it reads type
here to steer the turn, Enter to send until you start typing, then shows your
words as you type them. Above both, each finished step leaves a single dim line
behind, so the screen tells you what has been done without scrolling away.
You do not have to wait for a pause to change your mind. Type into that line while it works and press Enter:
> Use an 8x8x8 k-grid for the SCF.
The message is sent at once and LatticeMind reads it at its next step.
ctrl-c offers three choices: s to stop, d to leave the work running
and return to the prompt, w to keep watching.
4.4. Step 4 — Answer the permission question
Before any solver runs, LatticeMind shows exactly what it will run and where, and asks:
1. yes 2. yes, always 3. no
Pick a number, or just answer in words — yes, go ahead, run it, approve,
or no, don’t, cancel. /approve and /deny do the same thing.
Any request to build, set up or run a calculation ends at this question. If you would rather see the inputs first, ask for that instead: “Prepare the inputs but do not run anything.” That request stops before the launch.
Fig. 4.4.1 A turn in the terminal: one line per finished step, then the permission question before the solver runs.
yes, always is offered for ordinary shell commands (mkdir figures, say)
and stops LatticeMind asking about that command again in this folder. Solver
launches are asked about each time. If you would rather not answer routine
runs, type /approve-for-me on: prepared runs of low or medium estimated
cost then go ahead, while moves, deletions, scripts and expensive runs still
ask. /approve-for-me off returns to asking (see Interactive commands).
Once you say yes, the solver’s own output appears in the session as it is
written, so you can watch the SCF converge without opening a log file. RESCU’s
iteration lines, NanoDCAL’s output and VASP’s OSZICAR are shown dimmed, a
few lines at a time; the full log stays in the run folder.
4.5. Step 5 — Read the answer and find the files
When the turn finishes, LatticeMind gives you the answer in prose, then one line saying where the files are, then one sentence suggesting the next step.
The inputs sit at the top of your project folder (scf.input, …), results in
results/ and figures in results/plots/. Where the terminal supports
images, the figures are also drawn inline as they are made. Every number in the
answer is tied to a recorded result; /report writes the full evidence report
under results/ and prints where.
Fig. 4.5.1 Your first result: the silicon density of states, with the Fermi level in the gap. (See Silicon: SCF, band structure & DOS for the band structure and the numbers.)
4.6. Step 6 — Come back later
The conversation is saved. Run latticemind again in the same folder and it
picks up where you left off, with everything it computed still in place. Ask a
follow-up — “now compute the DOS with a finer grid” — and it builds on what is
already there. /new starts a fresh conversation in the same folder.
If a single conversation goes on to a second material, that second project gets its own subfolder, named after it, inside the folder you started in.
4.7. What next?
Learn how the conversation works: How LatticeMind works.
Try more materials and calculation types: Basic tutorials.
Scale up to a cluster: Running on a remote machine or cluster.
Tip
You can ask LatticeMind what it is doing and why at any point — “what did
that run actually establish?” — in the same plain language you used to start
it. /help lists the few commands that exist.