Error when invoking FHI-aims

Hi everybody
I used following code for running FHI-aims:
=================================================Preformatted text

from ase.calculators.aims import Aims
from ase.optimize import FIRE,BFGS
from ase.io import read, write
from ase.units import Ry, eV
from ase.io.trajectory import Trajectory


comp = read('geometry.in',format='aims')

calc = Aims(aims_command ="mpirun -np 12 /home/reza/aims_2023/build/aims.231212.mpi.x",
             outfilename='comp.out',
	     species_dir="/home/reza/aims_2023/species_defaults/defaults_2020/light",
	     xc='rpbe',
	     spin='collinear',
		 compute_forces='.true.',
		 sc_iter_limit=1000,
            default_initial_moment=0.05,
            relativistic=('atomic_zora','scalar'),
            n_max_pulay=10,
            occupation_type=('gaussian',0.2),
            charge_mix_param=0.2,
            sc_accuracy_rho=1E-4,
            sc_accuracy_eev=1E-2,
            sc_accuracy_etot=5E-5)

comp.calc=calc
comp.get_potential_energy()
qn = BFGS(comp, trajectory='z_opt.traj', logfile='z_forces.log')
qn.run(fmax=0.05)
write('z_opt.in',comp,format='aims')

====================================
but I see error:

Traceback (most recent call last):
  File "/home/reza/runs/test.py", line 10, in <module>
    calc = Aims(
           ^^^^^
  File "/home/reza/ase_master/ase/calculators/aims.py", line 214, in __init__
    super().__init__(
  File "/home/reza/ase_master/ase/calculators/genericfileio.py", line 335, in __init__
    raise EnvironmentError(f'No configuration of {template.name}')
ase.calculators.calculator.EnvironmentError: No configuration of aims

Any Idea?

There have been some changes to calculator configuration in the master branch of ASE. For now the best option is to stop using ase_command= and create a configuration file following these directions:

https://wiki.fysik.dtu.dk/ase/ase/calculators/calculators.html#calculator-configuration

Alternatively, I believe it is possible to pass binary and parallel_info arguments in a similar way to using aims_command; these would function as if they were in the config file documented above.

Be aware that this system is under development and may change again before the next release!

Thank you
I used config.ini and AIMS_SPECIES_DIR, and successfully ran FHI-aims combined with ASE. Now, I have a new problem. When SCF is converged, ASE tries to calculate the force, but it shows an error.
This is my python code:

from ase.io import read, write
from ase.calculators.aims import Aims
from ase.optimize import BFGS
from ase.io.trajectory import Trajectory

comp =read('geometry.in',format='aims') 

aims = Aims( xc='RPBE',
             sc_iter_limit=500,
            occupation_type=('gaussian','0.2'),
            charge_mix_param=0.4,
            n_max_pulay=10,
            sc_accuracy_etot=5e-5,
            relativistic=('atomic_zora','scalar'),
            sc_accuracy_eev=1e-2,
            sc_accuracy_rho=1e-4,
		parallel=True,
		parallel_info={'nprocs': 44},
            charge=0.0,
            spin='collinear',
            default_initial_moment=1.0,
            write_restart_geometry='.true.',
            compute_forces='.true.'
            )

comp.calc=aims
opt = BFGS(comp,logfile='z_forces_opt.log',trajectory='z_opt.traj')
opt.run(fmax=0.05)
write('z_opt.in',water,format='aims') 


and this is error:

Traceback (most recent call last):
  File "/home/reza/runs/opt_bfgs.py", line 29, in <module>
    opt.run(fmax=0.05)
  File "/home/reza/ase_master/ase/optimize/optimize.py", line 429, in run
    return Dynamics.run(self, steps=steps)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/reza/ase_master/ase/optimize/optimize.py", line 275, in run
    for converged in Dynamics.irun(self, steps=steps):
  File "/home/reza/ase_master/ase/optimize/optimize.py", line 225, in irun
    self.optimizable.get_forces()
  File "/home/reza/ase_master/ase/optimize/optimize.py", line 34, in get_forces
    return self.atoms.get_forces()
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/reza/ase_master/ase/atoms.py", line 812, in get_forces
    forces = self._calc.get_forces(self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/reza/ase_master/ase/calculators/abc.py", line 30, in get_forces
    return self.get_property('forces', atoms)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/reza/ase_master/ase/calculators/calculator.py", line 537, in get_property
    self.calculate(atoms, [name], system_changes)
  File "/home/reza/ase_master/ase/calculators/genericfileio.py", line 386, in calculate
    self.results = self.template.read_results(self.directory)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/reza/ase_master/ase/calculators/aims.py", line 164, in read_results
    return read_aims_results(dst, index=-1)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/reza/ase_master/ase/utils/__init__.py", line 577, in iofunc
    obj = func(fd, *args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/reza/ase_master/ase/io/aims.py", line 1704, in read_aims_results
    return chunks[index].results
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/reza/ase_master/ase/io/aims.py", line 1452, in results
    "eigenvalues": self.eigenvalues,
                   ^^^^^^^^^^^^^^^^
  File "/home/reza/ase_master/ase/utils/__init__.py", line 678, in getter
    cache[name] = meth(self)
                  ^^^^^^^^^^
  File "/home/reza/ase_master/ase/io/aims.py", line 1572, in eigenvalues
return self._parse_eigenvalues()["eigenvalues"]
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/reza/ase_master/ase/utils/__init__.py", line 678, in getter
    cache[name] = meth(self)
                  ^^^^^^^^^^
  File "/home/reza/ase_master/ase/io/aims.py", line 1388, in _parse_eigenvalues
    assert len(kpt_inds) == len(occupation_block_start)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError

Any idea?