Skip to content

Add templete for new method #14

@ohno

Description

@ohno

Minimal:

struct NewMethod
  # settings
end

struct ResultNewMethod
  # settings
end

function solve(hamiltonian::Hamiltonian, method::NewMethod)
  # calculation
  return ResultNewMethod()
end

function expectation(result::ResultNewMetho, o::Operator)
  # calculation
end

Optional:

Base.show(io::IO, method::FiniteDifferenceMethod) = print(io, Base.string(method))

Base.show(io::IO, result::FiniteDifferenceMethodResult) = print(io, Base.string(result))

Base.string(method::FiniteDifferenceMethod) = "FiniteDifferenceMethod(" * join(["$(symbol)=$(getproperty(method,symbol))" for symbol in fieldnames(typeof(method))], ", ") * ")"

function Base.string(result::FiniteDifferenceMethodResult)
  # ...
end

function verification(result::FiniteDifferenceMethodResult)
  # ...
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions