fortran66のブログ

fortran について書きます。

メモ帳 S-function の正規化

Littlewood の S-function の standardization

夏休みの勉強w

分割の共役

[\lambda_1,\lambda_2,..., \lambda_p] 
の共役は
[p^{\lambda_p},(p-1)^{\lambda_{p-1}-\lambda_p},...,1^{\lambda_1-\lambda_2}]

main = print (conj [4,3,3,2,2])

conj :: Partition -> Partition
conj [] = []
conj xs = conj' (xs ++ [0]) 

conj' :: Partition -> Partition
conj' [] = [] 
conj' [x] = [] 
conj' xs = (replicate (l2 - l1) p) ++ (conj' (init xs))
    where 
      p  = (length xs) - 1
      l1 = last xs
      l2 = last (init xs)
GHCi, version 8.0.1
   
[5,5,3,1]

□□□□
□□□
□□□
□□
□□

共役を取って

■■■■■
■■■■■
■■■

分割{λ}の正規化

分割{λ}を S-function とみて、{λ}が弱い減少列になっていない時に弱い減少列に直す。

規則1 尻の 0 は取り去る。
規則2 尻に負数が出たら 0。(ここではヌルとする)
規則3 隣り合う数の入れ替えは\{...\lambda_i, \lambda_{i+1},...\}=-\{...\lambda_{i+1}-1, \lambda_{i}+1,...\}


行き当たりばったりで適当w

main = print (standard (1, [2,1,3,6,1]))

type Partition = [Int]
type PartitionF = (Int, Partition) -- Partition with a (phase)factor

standard :: PartitionF -> PartitionF
standard (f, xs) = if stdq' xs then (f, xs)
                               else standard (std (f, xs))

std :: PartitionF -> PartitionF
std (f, [])= (f, [])
std (f, xs) = if (last xs) <  0 then (f, [])  
         else if (last xs) == 0 then std (f, init xs)
         else if (p1 xs)        then (f, [])
         else stdq (f, xs)

p1 :: Partition -> Bool
p1 xs = or [x == (y-1)|(x,y) <- ys ]
  where 
    ys = zip xs (tail xs)  
    
stdq :: PartitionF -> PartitionF
stdq (f, []) = (f, [])
stdq (f, xs) = if stdq' xs then (f, xs)
                           else std' (f, xs)
         
std' :: PartitionF -> PartitionF                           
std' (f, []) = (f, [])
std' (f, [x]) = (f, [x])
std' (f, x:y:xs) = if (x < y) then ex1 (f, x:y:xs)
                              else (f', x:xs')
    where 
      (f', xs') = std' (f, y:xs)

stdq' :: Partition -> Bool
stdq' xs = and [x >= y|(x,y) <- ys ]
  where 
    ys = zip xs (tail xs)     
    
ex1 :: PartitionF -> PartitionF
ex1 (f, x:y:xs) = (-f, (y-1):(x+1):xs) 
GHCi, version 8.0.1
   
(1,[3,3,3,3,1])