Molecule simulation

I am trying to simulate the Calcium Oxide (CaO) molecule and apparently the information about Calcium (Ca) is not recorded.

import pennylane as qml
from pennylane import numpy as np
from pennylane import qchem
coordenadas=np.array([[0.0, 0.0, 0.0], [2.75, 0.0, 0.0]])
H,qubits = qchem.molecular_hamiltonian(simbolos,coordenadas,charge=0)
hf=qchem.hf_state(electrons=28, orbitals=qubits)

I have this error:

ValueError                                Traceback (most recent call last)
Cell In[26], line 3
      1 simbolos=["O","Ca"]
      2 coordenadas=np.array([[0.2, 0.3, 0.33], [2.75, 0.11, 0.9]])
----> 3 H,qubits = qchem.molecular_hamiltonian(simbolos,coordenadas,charge=1)
      4 print(qubits)
      6 #hf=qchem.hf_state(electrons=28, orbitals=qubits)
      7 #print(hf)

File ~/Moleculas/moleculas/lib/python3.10/site-packages/pennylane/qchem/, in molecular_hamiltonian(symbols, coordinates, name, charge, mult, basis, method, active_electrons, active_orbitals, mapping, outpath, wires, alpha, coeff, args, load_data, convert_tol)
    926 if args is None and isinstance(geometry_dhf, qml.numpy.tensor):
    927     geometry_dhf.requires_grad = False
--> 928 mol = qml.qchem.Molecule(
    929     symbols,
    930     geometry_dhf,
    931     charge=charge,
    932     mult=mult,
    933     basis_name=basis,
    934     load_data=load_data,
    935     alpha=alpha,
    936     coeff=coeff,
    937 )
    938 core, active = qml.qchem.active_space(
    939     mol.n_electrons, mol.n_orbitals, mult, active_electrons, active_orbitals
---> 94     raise ValueError(f"Atoms in {set(symbols) - set(atomic_numbers)} are not supported.")
     96 self.symbols = symbols
     97 self.coordinates = coordinates

ValueError: Atoms in {'Ca'} are not supported.
Output is truncated. View as a scrollable element or open in a text editor. Adjust cell output settings...

Hello @Eduardo_Anderson_Sal,

The closest substitutes appear to be CO or -OH. Calcium has more orbitals, which likely adds to computational complexity. For now it looks like atoms are on the first two rows of the periodic table.


Hi @Eduardo_Anderson_Sal, welcome to the Forum and thank you for your question!

Currently, only atoms with atomic numbers 1-10 are supported, so everything up to and including Neon.

You may get information on molecules with other atoms using PennyLane with PySCF and OpenFermion, which are external packages. This will result in a Hamiltonian that is non-differentiable though. You can learn more about this in our demo on this topic.

Please let us know if you have any additional questions!

We also have a PennyLane survey where you can let us know your thoughts about PennyLane so that we can keep bringing you amazing features :star_struck:. We appreciate your feedback!