spin Derived Type

type, public :: spin


Contents


Components

TypeVisibility AttributesNameInitial
complex(kind=wp), public :: matrix(2,2) =0.0_wp

Encapsulate a spin matrix


Type-Bound Procedures

generic, public :: spin => cons_rscalar, cons_cscalar, cons_cmatrix, cons_rvector, cons_spin

  • private pure function spin_cons_rscalar(other) result(this)

    Constructs a spin object from a real scalar.

    Arguments

    Type IntentOptional AttributesName
    real(kind=wp), intent(in) :: other

    Return Value type(spin)

  • private pure function spin_cons_cscalar(other) result(this)

    Constructs a spin object from a complex scalar.

    Arguments

    Type IntentOptional AttributesName
    complex(kind=wp), intent(in) :: other

    Return Value type(spin)

  • private pure function spin_cons_cmatrix(other) result(this)

    Constructs a spin object from a complex matrix.

    Arguments

    Type IntentOptional AttributesName
    complex(kind=wp), intent(in) :: other(2,2)

    Return Value type(spin)

  • private pure function spin_cons_rvector(other) result(this)

    Constructs a spin object from a real vector.

    Arguments

    Type IntentOptional AttributesName
    real(kind=wp), intent(in) :: other(8)

    Return Value type(spin)

  • private pure function spin_cons_spin(other) result(this)

    Constructs a spin object from an existing one.

    Arguments

    Type IntentOptional AttributesName
    type(spin), intent(in) :: other

    Return Value type(spin)

generic, public :: assignment(=) => assr_rscalar, assr_cscalar, assr_cmatrix, assr_rvector, assl_cmatrix, assl_rvector

  • private pure subroutine spin_assr_rscalar(this, other)

    Imports data to a spin object from a real scalar.

    Arguments

    Type IntentOptional AttributesName
    class(spin), intent(inout) :: this
    real(kind=wp), intent(in) :: other
  • private pure subroutine spin_assr_cscalar(this, other)

    Imports data to a spin object from a complex scalar.

    Arguments

    Type IntentOptional AttributesName
    class(spin), intent(inout) :: this
    complex(kind=wp), intent(in) :: other
  • private pure subroutine spin_assr_cmatrix(this, other)

    Imports data to a spin object from a complex matrix.

    Arguments

    Type IntentOptional AttributesName
    class(spin), intent(inout) :: this
    complex(kind=wp), intent(in) :: other(2,2)
  • private pure subroutine spin_assr_rvector(this, other)

    Imports data to a spin object from a real vector.

    Arguments

    Type IntentOptional AttributesName
    class(spin), intent(inout) :: this
    real(kind=wp), intent(in) :: other(8)
  • private pure subroutine spin_assl_cmatrix(other, this)

    Exports data from a spin object to a complex matrix.

    Arguments

    Type IntentOptional AttributesName
    complex(kind=wp), intent(out) :: other(2,2)
    class(spin), intent(in) :: this
  • private pure subroutine spin_assl_rvector(other, this)

    Exports data from a spin object to a real vector.

    Arguments

    Type IntentOptional AttributesName
    real(kind=wp), intent(out) :: other(8)
    class(spin), intent(in) :: this

generic, public :: operator(+) => addl_rscalar, addr_rscalar, addl_cscalar, addr_cscalar, addl_cmatrix, addr_cmatrix, add_spin

  • private pure function spin_addl_rscalar(other, this) result(r)

    Defines left addition of a spin matrix and a real scalar.

    Arguments

    Type IntentOptional AttributesName
    real(kind=wp), intent(in) :: other
    class(spin), intent(in) :: this

    Return Value type(spin)

  • private pure function spin_addr_rscalar(this, other) result(r)

    Defines right addition of a spin matrix and a real scalar.

    Arguments

    Type IntentOptional AttributesName
    class(spin), intent(in) :: this
    real(kind=wp), intent(in) :: other

    Return Value type(spin)

  • private pure function spin_addl_cscalar(other, this) result(r)

    Defines left addition of a spin matrix and a complex scalar.

    Arguments

    Type IntentOptional AttributesName
    complex(kind=wp), intent(in) :: other
    class(spin), intent(in) :: this

    Return Value type(spin)

  • private pure function spin_addr_cscalar(this, other) result(r)

    Defines right addition of a spin matrix and a complex scalar.

    Arguments

    Type IntentOptional AttributesName
    class(spin), intent(in) :: this
    complex(kind=wp), intent(in) :: other

    Return Value type(spin)

  • private pure function spin_addl_cmatrix(other, this) result(r)

    Defines left addition of a spin matrix and a complex matrix.

    Arguments

    Type IntentOptional AttributesName
    complex(kind=wp), intent(in) :: other(2,2)
    class(spin), intent(in) :: this

    Return Value type(spin)

  • private pure function spin_addr_cmatrix(this, other) result(r)

    Defines right addition of a spin matrix and a complex matrix.

    Arguments

    Type IntentOptional AttributesName
    class(spin), intent(in) :: this
    complex(kind=wp), intent(in) :: other(2,2)

    Return Value type(spin)

  • private pure elemental function spin_add_spin(this, other) result(r)

    Defines addition of two spin matrices.

    Arguments

    Type IntentOptional AttributesName
    class(spin), intent(in) :: this
    class(spin), intent(in) :: other

    Return Value type(spin)

generic, public :: operator(-) => subl_rscalar, subr_rscalar, subl_cscalar, subr_cscalar, subl_cmatrix, subr_cmatrix, sub_spin

  • private pure function spin_subl_rscalar(other, this) result(r)

    Defines left subtraction of a spin matrix and a real scalar.

    Arguments

    Type IntentOptional AttributesName
    real(kind=wp), intent(in) :: other
    class(spin), intent(in) :: this

    Return Value type(spin)

  • private pure function spin_subr_rscalar(this, other) result(r)

    Defines right subtraction of a spin matrix and a real scalar.

    Arguments

    Type IntentOptional AttributesName
    class(spin), intent(in) :: this
    real(kind=wp), intent(in) :: other

    Return Value type(spin)

  • private pure function spin_subl_cscalar(other, this) result(r)

    Defines left subtraction of a spin matrix and a complex scalar.

    Arguments

    Type IntentOptional AttributesName
    complex(kind=wp), intent(in) :: other
    class(spin), intent(in) :: this

    Return Value type(spin)

  • private pure function spin_subr_cscalar(this, other) result(r)

    Defines right subtraction of a spin matrix and a complex scalar.

    Arguments

    Type IntentOptional AttributesName
    class(spin), intent(in) :: this
    complex(kind=wp), intent(in) :: other

    Return Value type(spin)

  • private pure function spin_subl_cmatrix(other, this) result(r)

    Defines left subtraction of a spin matrix and a complex matrix.

    Arguments

    Type IntentOptional AttributesName
    complex(kind=wp), intent(in) :: other(2,2)
    class(spin), intent(in) :: this

    Return Value type(spin)

  • private pure function spin_subr_cmatrix(this, other) result(r)

    Defines right subtraction of a spin matrix and a complex matrix.

    Arguments

    Type IntentOptional AttributesName
    class(spin), intent(in) :: this
    complex(kind=wp), intent(in) :: other(2,2)

    Return Value type(spin)

  • private pure elemental function spin_sub_spin(this, other) result(r)

    Defines subtraction of two spin matrices.

    Arguments

    Type IntentOptional AttributesName
    class(spin), intent(in) :: this
    class(spin), intent(in) :: other

    Return Value type(spin)

generic, public :: operator(*) => mull_rscalar, mulr_rscalar, mull_cscalar, mulr_cscalar, mull_cmatrix, mulr_cmatrix, mul_spin

  • private pure function spin_mull_rscalar(other, this) result(r)

    Defines left multiplication of a spin matrix by a real scalar.

    Arguments

    Type IntentOptional AttributesName
    real(kind=wp), intent(in) :: other
    class(spin), intent(in) :: this

    Return Value type(spin)

  • private pure function spin_mulr_rscalar(this, other) result(r)

    Defines right multiplication of a spin matrix by a real scalar.

    Arguments

    Type IntentOptional AttributesName
    class(spin), intent(in) :: this
    real(kind=wp), intent(in) :: other

    Return Value type(spin)

  • private pure function spin_mull_cscalar(other, this) result(r)

    Defines left multiplication of a spin matrix by a complex scalar.

    Arguments

    Type IntentOptional AttributesName
    complex(kind=wp), intent(in) :: other
    class(spin), intent(in) :: this

    Return Value type(spin)

  • private function spin_mulr_cscalar(this, other) result(r)

    Defines right multiplication of a spin matrix by a complex scalar.

    Arguments

    Type IntentOptional AttributesName
    class(spin), intent(in) :: this
    complex(kind=wp), intent(in) :: other

    Return Value type(spin)

  • private pure function spin_mull_cmatrix(other, this) result(r)

    Defines left multiplication of a spin matrix by a complex matrix.

    Arguments

    Type IntentOptional AttributesName
    complex(kind=wp), intent(in) :: other(2,2)
    class(spin), intent(in) :: this

    Return Value type(spin)

  • private pure function spin_mulr_cmatrix(this, other) result(r)

    Defines right multiplication of a spin matrix by a complex matrix.

    Arguments

    Type IntentOptional AttributesName
    class(spin), intent(in) :: this
    complex(kind=wp), intent(in) :: other(2,2)

    Return Value type(spin)

  • private pure elemental function spin_mul_spin(this, other) result(r)

    Defines multiplication of two spin matrices.

    Arguments

    Type IntentOptional AttributesName
    class(spin), intent(in) :: this
    class(spin), intent(in) :: other

    Return Value type(spin)

generic, public :: operator(/) => divr_rscalar, divr_cscalar

  • private pure function spin_divr_rscalar(this, other) result(r)

    Defines division of a spin matrix by a real scalar.

    Arguments

    Type IntentOptional AttributesName
    class(spin), intent(in) :: this
    real(kind=wp), intent(in) :: other

    Return Value type(spin)

  • private pure function spin_divr_cscalar(this, other) result(r)

    Defines division of a spin matrix by a complex scalar.

    Arguments

    Type IntentOptional AttributesName
    class(spin), intent(in) :: this
    complex(kind=wp), intent(in) :: other

    Return Value type(spin)

generic, public :: operator(**) => expr_iscalar

  • private pure function spin_expr_iscalar(this, other) result(r)

    Exponentiates the spin object, where the power is a positive integer.

    Arguments

    Type IntentOptional AttributesName
    class(spin), intent(in) :: this
    integer, intent(in) :: other

    Return Value type(spin)