Skip to content

Orbitals objects are not within "best practices"  #105

@gustavojra

Description

@gustavojra

According to Julia documentation, it is best to avoid fields with abstract containers.

This is exactly what we do with our orbital structures:

struct RHFOrbitals <: AbstractRestrictedOrbitals
    molecule::Molecule
    basis::String
    eps::AbstractArray{Float64,1}
    sd_energy::Float64
    C::AbstractArray{Float64,2}
end

Thus, it would be better (according to Julia documentation) to write

struct RHFOrbitals{A} <: AbstractRestrictedOrbitals
    molecule::Molecule
    basis::String
    eps::AbstractArray{Float64,1}
    sd_energy::Float64
    C::A
end

Thou, I doubt this would change performance since orbitals are very rarely created. (e.g. at the end of a computation)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions