Opened 13 years ago

Closed 13 years ago

# [with patch, positive review] A correction to the weight of crystal elements for type A and a speedup for all types

Reported by: Owned by: bump mhansen minor sage-3.0 combinatorics sage-combinat

### Description

For Cartan Types 'A' a problem with the weight function of crystals was described here:

The method of correcting this problem was to hard-code the weight in the crystals of letters, and to have the crystals of tensors get the weight of a tensor element by summing the weights of its constituents. This alters the weight for Type A (correcting the defect) and returns the same weight as the old algorithm for other Cartan types.

When the patch was implemented it was found to be 2-3 times faster than the old algorithm.

### Changed 13 years ago by bump

patch correcting problem with weights for crystal graphs of type A and speeding up all Cartan types.

### comment:1 Changed 13 years ago by mabshoff

• Summary changed from A correction to the weight of crystal elements for type A and a speedup for all types to [with patch, needs review] A correction to the weight of crystal elements for type A and a speedup for all types

### comment:2 Changed 13 years ago by mhansen

• Summary changed from [with patch, needs review] A correction to the weight of crystal elements for type A and a speedup for all types to [with patch, needs minor work] A correction to the weight of crystal elements for type A and a speedup for all types

Hi Dan,

I've updated a patch to move the tests for .weight() to the docstring for the definition of weight. There is an issue with ['G',2] though:

Before the patch:

```sage: C = CrystalOfLetters(['G',2])
sage: hwvs = C.highest_weight_vectors()
sage: wlr = C.weight_lattice_realization()
sage: v = hwvs[0]; v
1
sage: v.weight()
(1, 0, -1)
sage: wlr.weyl_dimension(v.weight())
7
```

After the patch:

```sage: C = CrystalOfLetters(['G',2])
sage: wlr = C.weight_lattice_realization()
sage: hwvs = C.highest_weight_vectors()
sage: hwvs
[1]
sage: v = hwvs[0]; v
1
sage: v.weight()
(-1, 0, 1)
sage: wlr.weyl_dimension(v.weight())
0
```

### comment:3 follow-up: ↓ 4 Changed 13 years ago by bump

I was unable to confirm the problem with G2. I applied the patch in the modified form that you posted, and sage: wlr.weyl_dimension(v.weight()) returns 7 for me.

Dan

### comment:4 in reply to: ↑ 3 ; follow-up: ↓ 5 Changed 13 years ago by mabshoff

I was unable to confirm the problem with G2. I applied the patch in the modified form that you posted, and sage: wlr.weyl_dimension(v.weight()) returns 7 for me.

Dan

Hi Dan,

I can confirm that with 3.0.alpha2 and your patch applied wlr.weyl_dimension(v.weight()) returns 0. With what build did you try? Are there any other patches you have in your tree?

Cheers,

Michael

### comment:5 in reply to: ↑ 4 Changed 13 years ago by bump

Hi Dan,

I can confirm that with 3.0.alpha2 and your patch applied wlr.weyl_dimension(v.weight()) returns 0. With what build did you try? Are there any other patches you have in your tree?

Cheers,

Michael

I did this with 3.0-alph0 and no other patches. I can install 3.0.alpha2 and debug the patch.

Dan

### comment:6 Changed 13 years ago by bump

It turns out that I had forgotten the G2 patch that went in on Saturday.

I corrected the patch and added it as 2853.1.patch. I believe it is now correct.

Dan

### comment:7 Changed 13 years ago by mhansen

• Summary changed from [with patch, needs minor work] A correction to the weight of crystal elements for type A and a speedup for all types to [with patch, positive review] A correction to the weight of crystal elements for type A and a speedup for all types

Looks good to me. Apply just 2853.1.patch.

### comment:8 Changed 13 years ago by mabshoff

• Resolution set to fixed
• Status changed from new to closed

Merged in Sage 3.0.alpha3.