Skip to content

Issue with "Unregistered type : deft::Array<double>" #15

Description

@cw-tan

When I was testing out the example on the PROFESS website where we optimize the density of fcc Al and plot its electron density, I faced some errors involving the deft array types.

Minimal code to reproduce the error:

import profess
import numpy as np

box_vectors = 4.05 * np.identity(3)
energy_cutoff = 1200
system = profess.System.create(box_vectors, energy_cutoff, ['a','ev'])
den = system.electron_density  # error here

Error message:

TypeError: Unregistered type : deft::Array<double>

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/cw/OFDFT/profess/example/example.py", line 7, in <module>
    den = system.electron_density  # error here
TypeError: Unable to convert function return value to a Python type! The signature was
        (self: profess.System) -> deft::Array<double>

Trying den = system.electron_density[...] still results in the same error. Not sure if this is a result of the updated pybind11, or something about my system.

Versions:
python --version gives Python 3.10.8
cmake --version gives cmake version 3.22.1
gfortran --version gives GNU Fortran (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0 ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions