Simple model to visualize H2

Dear users, I am just trying to visualize a simple molecule like H₂ with its bond, but I am encountering an error when running the program:

LAMMPS-GUI Error

ERROR: Numeric index 1 is out of bounds (1-0) (src/MOLECULE/bond_harmonic.cpp:129)

I am using this part in the script:

bond_style harmonic
bond_coeff 1 450.0 0.74
create_bonds 1 1 2

Thank you in advance for your help
MG

But this is not the part that matters.

You need to reserve space for bond types and bonds per atom and special neighbors per atom and use a suitable atom style before you can define bonds.

This problem has come up many times before, so you can search through the archives and read previous, more detailed explanations.

Thank you for your answer, I will search through the archives :+1: