AI use

Using AI in research and simulation

AI tools are now part of everyday work in science. Chat assistants answer questions, explain methods, and write code, and machine learning models have become part of the simulations themselves. When they are used well, they save time, catch mistakes, and make it much easier to learn something new or to turn an idea into something that works. When they are used carelessly, they give confident answers that are wrong, and they can leak data that should stay private. This page covers where AI helps, how to use it well, where it goes wrong, and what to be careful about.

Where AI helps

four gains

AI in molecular simulation

next to the model and inside it

In simulation work, AI helps in two different ways. An assistant can help with the work around a simulation, and machine learning models can become part of the simulation itself.

Next to the simulation
An assistant can write a first input file for GROMACS or LAMMPS from a short description of the system and explain what each line does. It can write the job script for a cluster, the analysis script that turns a trajectory into a density profile or a radial distribution function, and the code for the figures. When a run crashes, it can read the log file and suggest where the problem is. It can also translate code, for example from a slow Python loop to NumPy, or from one simulation package to another.
Inside the simulation
Machine learning potentials, such as MACE, learn energies and forces from quantum chemistry and then run MD close to that accuracy at a fraction of the cost. Active learning lets a potential choose the new calculations it needs. Machine-learned coarse-grained models learn the forces between beads from all-atom simulations. Surrogate models and Bayesian optimization pick the next simulation or experiment, so that fewer runs are needed to find a good recipe. The ideas behind these methods are explained on the machine learning in MD page.

Using it well

seven habits

  1. Ask about things you can check. AI is most useful for problems where you know what a right answer looks like, such as a value from a paper, a limiting case, or a quantity that should stay constant.
  2. Give the full context. Say which software and which version you use, the units, and what the system is. Good context gives better answers, and it makes wrong answers easier to spot.
  3. Work in small steps. Ask for one piece at a time, run it, and check it before asking for the next piece. A long answer that does everything at once is hard to check.
  4. Ask why, not only what. Ask for the reason behind each step. If you cannot explain a line of code or an equation in your own words, it is not ready to use.
  5. Test on a case with a known answer. Before a new script meets the real system, run it on an ideal gas, a harmonic oscillator, or a Lennard-Jones fluid at a state point from the literature. A script that fails on a simple case cannot be trusted on a hard one.
  6. Keep learning. Use the assistant to learn, not only to finish. Write a small piece yourself first and then compare, or ask it to quiz you. Over time, you need it less for the basics and more for new things.
  7. Keep your own voice and judgment. For text, write the ideas yourself and use the assistant for grammar and clarity. For decisions, treat its answer as one opinion and make the final call yourself.

Downsides and how to avoid them

six problems

The most serious mistakes give no error message. A script with a time step that is too large, a thermostat that does not fit the question, or a distance that ignores the periodic box still runs and still gives numbers. In the figure, both integrators run without any complaint. Euler adds a little energy at every step, so its orbit spirals outward, while velocity Verlet stays on the circle. If you raise the time step, the difference grows quickly.

A simple check of a quantity that should stay constant catches this kind of mistake, whoever wrote the code. There is more about integrators on the molecular dynamics page.

Things to be careful about

before you paste or run

  1. Private data

    Anything pasted into an online assistant leaves your computer and may be stored. Data from a company, unpublished results, and personal data should only go into tools that your company or university has approved.

  2. Passwords and keys

    Never paste a password, an API key, or a private key, not even hidden inside a script, a configuration file, or a log.

  3. Commands you have not read

    Read every command before you run it, especially one that deletes files, changes permissions, or sends many jobs to a shared cluster.

  4. Licenses and credit

    Generated code and text can be close to existing work. Check the license before you reuse code, and cite the papers and software that a method comes from.

  5. Rules for papers and theses

    Journals, universities, and companies have their own rules on AI use. Most journals do not accept an AI tool as an author, and a manuscript under review is confidential, so it should not go into an online tool. When it matters, say how AI was used.

  6. Safety questions

    Check any advice about chemicals, lab equipment, or health against the safety data sheet, the manual, or an expert. Here, a wrong answer can hurt someone.

Overall, AI tools work best for people who know what a right answer looks like. They make good work faster and learning easier, but the person who uses them stays responsible for the result.