ohno / Antique.jl

Self-contained, well-tested, well-documented Analytical Solutions of Quantum Mechanical Equations.
https://ohno.github.io/Antique.jl/
MIT License
19 stars 3 forks source link

Variable names conflict #39

Closed ohno closed 6 months ago

ohno commented 6 months ago

using Antique: V as potential is the technique to avoid conflicting variable names.

julia> V = [1 2; 3 4]
2×2 Matrix{Int64}:
 1  2
 3  4

julia> using Antique
WARNING: using Antique.V in module Main conflicts with an existing identifier.

julia> using Antique: V as potential

julia> HA = HydrogenAtom()
HydrogenAtom(1, 1.0, 1.0, 1.0, 1.0)

julia> V(HA,1)
ERROR: MethodError: objects of type Matrix{Int64} are not callable
Use square brackets [] for indexing an Array.
Stacktrace:
 [1] top-level scope
   @ REPL[5]:1

julia> potential(HA,1)
-1.0