Thank you very much for such a comprehensive answer.

On 10 September 2010 16:27, Raul Miller <[email protected]> wrote:
> Ouch, you are taking very small steps in
> your code, and it requires quite a bit of
> thought to step back and try to see the bigger
> picture.
>
> One of the first things I noticed was that addVP
> was always used with rank 0 1.  So it would make
> sense to move that rank into its definition.
>
> Another thing I noticed was that addVP and
> cartanReflect were both using origin 1 indices
> which required extra code to use.  So it would
> make sense to use origin 0 (for cartanReflect)
> and only adjust the numbers used for addVP.
>
> These would simplify the right part of the hook
> newFromWeight from >:@:(0&< # i. @: #)
> to I.@:>&0
>
> But then there's the bit where addVP is being
> used at rank 0 1, and it's really just generating
> a bit vector -- one invocation of an explicit
> function per generated bit seems like a bit much.
>
> Its rank 0 1 definition is: given a count x and
> a vector 1 return 1 if numbers after the first
> x are non-negative.  And if we could turn x into
> an index, instead of a count, we would not have
> to add 1 to it before it was useful.
In fact I found a better definition for addVP. It should do this:
(*./@:(>:&0)@:}.)

addVP <=> the numbers after the nth index are non-negative

What newFromWeight is doing is reflecting the weight in the mirrors n
where the nth components of the weight are positive, and then keeping
those approved by addVP. Could it be done differently? ("n reflect
weight" means reflecting in the nth mirror)

The weight is a vector in n-dimensional space. Each weight is in a
vector space that is acted upon by a group generated by n reflections
in mirrors as embodied by the Cartan Matrix. Each row in the Cartan
Matrix corresponds to a certain reflection. It encodes the dot product
between a certain perpendicular vector to the mirror corresponding to
itself and those of all of the other reflections. A reflection acting
on a weight produces a new weight which is on the opposite side of the
mirror corresponding to the reflection.

When the orbit is calculated with the initial vector n $ 1, one gains
a 1-to-1 correspondence to the elements in the group generated by the
reflections. That's the reason why I'm generating these weights.

>
> In other words,
>
>   (1+0 2 3) addVP"0 1]_1 _3  1  1, 1 _3 _1  2,: 1 _4  2 _1
> 0 1 1
>   (0 2 3) ((>: (#,:@i.)/@$) */"1@:+. 0&<@])_1 _3  1  1, 1 _3 _1  2,: 1 _4  2 
> _1
> 0 1 1
>
> But this is just scratching the surface...
>
> I am still trying to deduce the purpose of "reflect" or,
> more properly, the purpose of nextLevel.  I feel that
> some serious simplifications are possible, but I am
> too wrapped up in details to see where I want to go
> right now.
>
> That said, here is my current code, which
> I think is equivalent to yours:
>
> cartReflect =: 1 : 0
> :
>  y - y *&(x&{) m
Is there a reason here why you haven't used &: ? Am I right in
thinking that they & and &: are interchangeable in this case?
> )
> keepv =:(>: (#,:@i.)/@$) */"1@:+. 0&<@]
> byLev =: 3 : 0
>  'w A maxLevel' =. y
>  reflect =: A cartReflect"0 1
>  newFromWeight =. 4 : '(#~ y&keepv) y reflect x' I.@:>&0
>  nextLevel =. ;@:(<@newFromWeight " 1)
>  currentLevel =. weights =.,: w
>  for.i.maxLevel
>  do.
>    currentLevel =. nextLevel currentLevel
>    weights =. weights , currentLevel
>  end.
> )
> A =: 4 4 $ 2 _1 0 0 _1 2 _1 0 0 _1 2 _1 0 0 _1 2
> assert (byLev-: byLevel) (1 1 1 1 ; A ; 10)
>
> (where byLevel is your implementation)
>
> Can you describe the purpose of this code?
>
> (I might be able to figure this out for myself, but for
> now I just need to get out of the weeds.)
>
> One obvious step, by the way, would be to define
> newFromWeight so it did not need to be used at
> rank 1, which should get rid of the need for the
There's a varying amount of new weights from each weight in the
current level. Is there still a solution?
> (;@:)(<@) thing you have there.  A related issue
> would be to get rid of the need for rank 0 1 in
> the definition of reflect itself.
>
> But there are so many things I do not understand,
> about the concepts underlying this code.  For example,
> what are "weights" and what do they accomplish?
>
> Thanks,
>
> --
> Raul
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>

Thanks again,

Justin
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to