# メモ帳 S-function の正規化

### Littlewood の S-function の standardization

#### 分割の共役 の共役は main = print (conj [4,3,3,2,2])

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

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]

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

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

#### 分割｛λ｝の正規化

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])