# -*- mode: org; -*-

* TODO [2026-07-26 Sun] firstState
  Haydock modules have a firstState field that default to a
  macroscopic field, but may be initialized  to an arbitrary
  field. However, they expect the field in reciprocal space, and in
  some cases, a spinor. Converting from a field in real space may
  generate errors, so the conversion from real space field to spinor
  field in reciprocal space should be handled by the modules
  themselves. A public method to transform between these
  representations is desirable, or a different optional field to
  specify the first state either in its final form or as a field in
  real space.

* TODO [2026-07-22 Wed] Check documentation
  The documentation is not quite consistent. It has to be checked and
  fixed systematically

* TODO [2026-07-22 Wed] MooX::StricConstructor
  I can't use strict constructors in some projected objects, as currently the
  corresponding tensor calculations initialize arrays of constructors using
  additional parameters, which seems unsafe. I have to construct them
  safely and add the constriction. The suspects are routines in
  Ph::Util such as make_haydock, _haydock_extra, make_greenp, and incarnate_as.
* DONE [2026-05-08 Fri] pod-coverage
  Test all attributes are pod covered
  My current xt/pod-coverage.t doesn't test lazy attributes. I don't
  understand why. Currently, there are many undocumented. I have to
  document them and I would like the tests to help with them.
* DONE [2025-08-02 Sat] firstState
  Check firstState in unretarded spinor calculations
  I use \delta_{G0}/sqrt2 for both the positive and negative parts. My
  guess is that the correct value is to change the sign of the G=0
  contribution, and that it won't affect any result. But for initial fields
  with many G's, it might make a difference. I have to make the
  corresponding changes to the tests also.

  Finally I conjugated the counterpropagating field in spinor
  calculations.

* DONE [2025-04-30 Wed] Field normalization
  - The normalization of the fields is done so that in the usual case
    the field is normalized to the macroscopic field. However, it is
    not clear if it will work when a firstState is given.
  - It should be possible to unnormalize it, so that it corresponds to
    a given external current or external polarization.
  - That was the purpose of the epsL field in LE::NR2::Field. I can
    add ad-hoc methods to the others, but It will be better to think
    it over and do it correctly.
  - If a firstState is given, there should be no need and no use for
    polarization in ...::Field

    I made rawfield methods to return the unnormalized field,
    interpreting the first state as an external polarization.
* TODO [2025-02-20 Thu] KeepStates
  - It seems version 0.24 keeps states, without regards to keepStates,
    as the states are now kept in a state pdl instead of a perl
    array.
* TODO [2025-02-20 Thu] Ph::Role::Geometry
  - I don't know why the normalized vector 0 is initialized in BUILD
    instead of in _build_GNorm
* TODO [2025-02-20 Thu] StrictConstructor
  - At someplace MooseX::StricConstructor dissapeared from the
    package. I guess it can be useful to add MooX::StrictConstructor
    to the package.
* TODO [2024-12-21 Sat] Geometry
  - It would be nice to be able to set the origin of the unit cell in geometry
  - It would be nice to have functions to map from pixel to cartesian
    coordinates and back in geometry
* TODO [2024-12-11 Wed] Documentation
  Should complete and verify documentation. For example, routines ST
  are not documented yet.
* TODO [2024-12-07 Sat] P::WE::R2::...
  Make a new version of P::WE::R2 in which the metric is not g, but
  g^dagger. This would make B g->g^dager B g Hermitian even if the
  host epsilon_A is dissipative, and the code would be simpler. The
  Haydock coefficients a_n, b_n would be complex, but there would be no need
  for the signs g_n.
* TODO [2024-12-06 Fri] Vectors2DList or Geometry
  Vectors 2D list should base the vectors on the actual coordinates,
  not in the index coordinates, i.e., it should use the r attribute
  from the geometry. Otherwise, it couldn't be used for non-orthogonal
  coordinates. Or instead, add routines to P::Roles::Geometry to
  convert from pixel to real space (or reciprocal) coordinates and back.
* TODO [2024-12-05 Thu] Immutability
  Immutable objects that return a pdl may be silently changed if the
  pdl itself is changed. It must be fixed, but I don't know what is
  the best way.
* DONE Field modifies silently haydock coefficients
  - [2024-12-04 Wed] We found P::LE::NR2::Field uses cgtsv, a routine that modifies its
    arguments. We used to pass a subdiagonal and supradiagonal which are
    both given by the b coefficients. We used the same ndarray, so when
    the subdiagonal is modified, the supradiagonal is erroneously
    modified. The results were wrong.
  - [2025-01-05 Sun] Modified Utils::cgtsv so that it takes care of
    copying the arrays that get modified
* TODO [2024-11-01 Fri] It seems WE::S::Green doesn't compute antisymmetric part. Fix and test.
* DONE [2021-09-30 Sun] Add example/test with non Cartesian coordinates
* TODO [2021-09-25 Sat] Check if it is clear that complexCoeffs is equivalent to non is_hermitian
* DONE Return as, bs, b2s as pdl instead of array?
* DONE Check upper iterations in continued fractions
* DONE Factor out OneH?
  Did for retarded and non retarded, 2 media
  Did for the rest.
* DONE Relax need for odd dimensions
* TODO Merge exact surface SHG calculation with current surface calculation.
* TODO Write and publish paper.
  Wrote a contribution to Science Perl, to appear in 2025.
* DONE Allow non-orthogonal unit vectors
* DONE Allow saving states for reorthogonalization and reinitialization
  Done for reorthogonalization. Reinitialization pending.
* DONE [2019-01-04 Fri] Generalize to three or more media nonretarded
* DONE Complete spinor generalization.
* DONE Generalize to three or more media retarded

* DONE [2018-11-20 Tue] Add TODO file
