Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Orbitals objects are not within "best practices" #105

Open
gustavojra opened this issue Aug 30, 2021 · 0 comments
Open

Orbitals objects are not within "best practices" #105

gustavojra opened this issue Aug 30, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@gustavojra
Copy link
Member

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)

@gustavojra gustavojra added the enhancement New feature or request label Sep 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant