ohno/Antique.jl

Programming paradigm & style

Closed this issue · 3 comments

ohno commented

This is a continuation of previous discussions #3 .

ohno commented

@hyrodium

Thank you for your comments and discussion. I am planning to rewrite codes as multi-dispatch style before adding new models. Please see a notebook on gist. I have considered multi-dispatch style with reference to your past comment.

Multi-dispatch coding allows to adapt Symbolics.jl, Measurements.jl, etc. I am not going to specify a type of the struct to adapt these packages.

Although the internal implementation a little loses its similarity to formulae, the usage is similar to formulas. For example, the energies of $\mathrm{H}$ and $\mathrm{He}^+$ are occasionally wrriten as $E(\mathrm{H})$ and $E(\mathrm{He}^+)$. In the multi-dispatch version, we can write it like this:

H = HydrogenAtom(Z=1)
E(H)
He⁺ = HydrogenAtom(Z=2)
E(He⁺)

There are some undecided matters.

  • Should multi-dispatch be applied to Hermitian polynomials H(x) as well?
  • Should codes be into a module?
    • Modules are useful for document build.
    • The module name and the type name conflict. What should I name the module?
    • Not necessarily for multi-dispatch Hermitian polynomials.
  • etc...

The multi-dispatch version is scheduled to be released as v0.2.0. I will continue to support antique() as a deprecated function and display an alert.

@hyrodium
I rewrote all of codes, documents and tests for multi-dispatch style. There was a small problem but it passed tests. These will be merged and released as v.0.2.0. Thank you again for your advices.

Great job! Looking forward to seeing you in JuliaTokyo 😄