43 integer,
public :: nyoung
44 integer :: nup, ndown, iyoung
45 integer,
allocatable,
public :: young_up(:,:)
46 integer,
allocatable,
public :: young_down(:,:)
53 integer,
intent(in) :: nup, ndown
54 type(young_t),
intent(inout) :: this
61 write (
message(1),
'(a)')
'We only make 2-row Young diagrams with nup >= ndown'
71 this%nyoung = this%nyoung / (ndown-ipart+1)
73 this%nyoung = this%nyoung / (nup -ipart+2)
75 do ipart = ndown+1, nup
77 this%nyoung = this%nyoung / (nup -ipart+1)
80 safe_allocate(this%young_up (1:nup, 1:this%nyoung))
81 safe_allocate(this%young_down(1:ndown,1:this%nyoung))
83 this%young_up(:, :) = -999
84 this%young_down(:, :) = -999
95 integer,
intent(in) :: nn
96 type(young_t),
intent(inout) :: this
101 if (this%iyoung > this%nyoung)
then
107 do idown = this%ndown, 1, -1
108 if (this%young_down(idown, this%iyoung) == -999)
then
109 this%young_down(idown, this%iyoung) = nn
114 this%iyoung = this%iyoung+1
115 if (this%iyoung <= this%nyoung)
then
116 this%young_up(:,this%iyoung) = this%young_up(:,this%iyoung-1)
117 this%young_down(:,this%iyoung) = this%young_down(:,this%iyoung-1)
125 if (this%iyoung > this%nyoung)
then
131 do iup = this%nup, 1, -1
132 if (this%young_up(iup, this%iyoung) == -999)
then
134 if (iup > this%ndown)
then
135 this%young_up(iup, this%iyoung) = nn
140 this%iyoung = this%iyoung+1
141 if (this%iyoung <= this%nyoung)
then
142 this%young_up(:,this%iyoung) = this%young_up(:,this%iyoung-1)
143 this%young_down(:,this%iyoung) = this%young_down(:,this%iyoung-1)
148 else if (this%young_down(iup, this%iyoung) /= -999)
then
149 this%young_up(iup, this%iyoung) = nn
154 this%iyoung = this%iyoung+1
155 if (this%iyoung <= this%nyoung)
then
156 this%young_up(:,this%iyoung) = this%young_up(:,this%iyoung-1)
157 this%young_down(:,this%iyoung) = this%young_down(:,this%iyoung-1)
166 if (this%iyoung > this%nyoung)
then
185 type(
young_t),
intent(inout) :: this
186 integer,
intent(in) :: nn
188 integer :: iup, idown
194 if (this%young_up(iup,this%iyoung) == nn+1) this%young_up(iup,this%iyoung) = -999
196 do idown = 1, this%ndown
197 if (this%young_down(idown,this%iyoung) == nn+1) this%young_down(idown,this%iyoung) = -999
206 integer,
intent(in) :: iunit
207 type(
young_t),
intent(inout) :: this
213 write (iunit,
'(a,I4,a,I4,a)')
' Young diagrams for ', this%nup,
' spins up, and ', this%ndown,
' down '
214 do iyoung = 1, this%nyoung
224 integer,
intent(in) :: iunit
225 type(
young_t),
intent(inout) :: this
227 integer,
intent(in) :: iyoung
231 write (iunit,
'(a,I7)')
' Young diagram ', iyoung
232 write (iunit,
'(10I7)') this%young_up(:, iyoung)
233 write (iunit,
'(10I7)') this%young_down(:, iyoung)
242 integer,
intent(in) :: iunit, nparticles
243 integer :: nup, ndown
249 nup = nparticles - ndown
260 integer,
intent(in) :: nparticles
261 integer,
intent(out) :: ndiagrams
262 integer :: nup, ndown
269 nup = nparticles - ndown
271 ndiagrams = ndiagrams + this%nyoung
281 type(
young_t),
intent(inout) :: this
285 safe_deallocate_a(this%young_up)
286 safe_deallocate_a(this%young_down)
double floor(double __x) __attribute__((__nothrow__
real(real64), parameter, public m_half
This module is intended to contain "only mathematical" functions and procedures.
recursive integer function, public factorial(n)
character(len=256), dimension(max_lines), public message
to be output by fatal, warning
subroutine, public messages_fatal(no_lines, only_root_writes, namespace)
subroutine, public young_end(this)
subroutine, public young_init(this, nup, ndown)
recursive subroutine young_fill(this, nn)
subroutine young_reset_1val(this, nn)
subroutine, public young_ndiagrams(nparticles, ndiagrams)
subroutine, public young_write_one(iunit, this, iyoung)
subroutine, public young_write(iunit, this)
subroutine, public young_write_allspins(iunit, nparticles)
routine gets all Young diagrams for all distributions of spins