version 0.012


    use Photonic::WE::S::OneH;
    my $nr=Photonic::WE::S::OneH->new(metric=>$g, polarization=>$p);
    say $nr->iteration;
    say $nr->current_a;
    say $nr->next_b2;
    my $state=$nr->nextState;


Implements calculation of Haydock coefficients and Haydock states for the calculation of the retarded dielectric function of arbitrary periodic systems in arbitrary number of dimensions, one Haydock coefficient at a time. It uses the wave equation and the spinor representation.


  • new(metric=>$m, polarization=>$e, [, smallH=>$s])

    Create a new Ph::OneH::R2 object with PDL::Metric::R2 $m, with a field along the complex direction $e and with small convergence parameter $s.

ACCESORS (read only)

  • metric Photonic::WE::S::Metric

    A Photonic::WE::S::Metric object defining the geometry of the system, the charateristic function, the wavenumber, wavevector and host dielectric function. Required in the initializer.

  • polarization PDL::Complex

    A non null vector defining the complex direction of the macroscopic field.

  • smallH

    A small number used as tolerance to end the iteration. Small enough b^2 coefficients are taken to be zero. From Photonic::Roles::EpsParams.

  • B ndims dims epsilon

    Accesors handled by metric (see Photonic::WE::S::Metric)

  • previousState currentState nextState

    The n-1-th, n-th and n+1-th Haydock states at the n-th iteration; a complex vector-spinor for each reciprocal wavevector. Dimensions ri,xy,pm,nx,ny...

  • current_a

    The n-th Haydock coefficient a

  • current_b2 next_b2 current_b next_b

    The n-th and n+1-th b^2 and b Haydock coefficients

  • next_c

    The n+1-th c Haydock coefficient

  • previous_g current_g next_g

    The n-1-th n-th and n+1-th g Haydock coefficients

  • iteration

    Number n of completed iterations


  • iterate

    Performs a single Haydock iteration and updates current_a, next_b, next_b2, next_c, next_g, next_state, shifting the current values where necessary. Returns 0 when unable to continue iterating.

  • applyMetric($psi)

    Returns the result of applying the metric to the state $psi.

  • applyOperator($psi_G)

    Apply the 'Hamiltonian' operator to state $psi_G. State is ri,xy,pn,nx,ny... The Hamiltonian is the metric followed by the dielectric esponse relative to the reference response.

  • innerProduct($left, $right)

    Returns the inner Euclidean product between states with the metric.

  • magnitude($psi)

    Returns the magnitude of a state as the square root of the magnitude of inner product of the state with itself.

  • changesign

    Returns 0, as there is no need to change sign.


  • $s= _firstState($self)

    Returns the fisrt state $v.


Photonic - A perl package for calculations on photonics and metamaterials.

Copyright (C) 1916 by W. Luis Mochán

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA

    Instituto de Ciencias Físicas, UNAM
    Apartado Postal 48-3
    62251 Cuernavaca, Morelos