# Wall-crossing¶

This module contains algorithms related to wall-crossing.

We define the class `WCS` associated to a lattice with a skew-symmetric form (or to a quiver). This class contains the quantum affine plane where all invariants live and where wall-crossing takes place. It also contains algorithms to jump between various types of invariants:

1. Stacky, Rational, Integer invariants associated to a stability parameter.

2. Total invariant (stacky invariant associated to the trivial stability parameter).

3. Stacky, Rational, Integer invariants associated to the attractor stability.

4. Invariant counting stable representations of a quiver for a given stability parameter.

EXAMPLES:

```sage: from msinvar import *
sage: Q=KroneckerQuiver(2); Q
Kronecker quiver: Quiver with 2 vertices and 2 arrows
sage: Q.prec([2,2]) #fix precision vector
sage: Q.total().dict()
{(0, 0): 1,
(0, 1): y/(-y^2 + 1),
(0, 2): y^2/(y^6 - y^4 - y^2 + 1),
(1, 0): y/(-y^2 + 1),
(1, 1): y^4/(y^4 - 2*y^2 + 1),
(1, 2): y^7/(-y^8 + 2*y^6 - 2*y^2 + 1),
(2, 0): y^2/(y^6 - y^4 - y^2 + 1),
(2, 1): y^7/(-y^8 + 2*y^6 - 2*y^2 + 1),
(2, 2): y^12/(y^12 - 2*y^10 - y^8 + 4*y^6 - y^4 - 2*y^2 + 1)}
```
```sage: I=Q.stacky([1,0]); I.dict()
{(0, 0): 1,
(0, 1): y/(-y^2 + 1),
(0, 2): y^2/(y^6 - y^4 - y^2 + 1),
(1, 0): y/(-y^2 + 1),
(1, 1): (y^2 + 1)/(y^2 - 1),
(1, 2): y/(-y^2 + 1),
(2, 0): y^2/(y^6 - y^4 - y^2 + 1),
(2, 1): y/(-y^2 + 1),
(2, 2): (y^6 + y^4 + 2*y^2)/(y^6 - y^4 - y^2 + 1)}
sage: I1=Q.stk2int(I); I1.dict()
{(0, 1): 1, (1, 0): 1, (1, 1): (-y^2 - 1)/y, (1, 2): 1, (2, 1): 1}
```
```sage: I=Q.stacky([0,1]); I.dict()
{(0, 0): 1,
(0, 1): y/(-y^2 + 1),
(0, 2): y^2/(y^6 - y^4 - y^2 + 1),
(1, 0): y/(-y^2 + 1),
(2, 0): y^2/(y^6 - y^4 - y^2 + 1)}
sage: I1=Q.stk2int(I); I1.dict()
{(0, 1): 1, (1, 0): 1}
```
```sage: Q.intAtt().dict() #integer attractor invariants
{(0, 1): 1, (1, 0): 1}
```
```sage: Q.stable([1,0], slope=1/2).dict() #invariants of stable moduli spaces
{(1, 1): y^2 + 1}
```
class `msinvar.wall_crossing.``WallCrossingStructure`(rank=0, sform=None, prec=None)[source]

Bases: `object`

Wall-crossing structure.

Contains the quantum affine algebra and methods to compute and transform different types of invariants (stacky, rational, integer DT invariants corresponding to different stability parameters).

INPUT:

• `rank` – Rank of the lattice.

• `sform` – Skew-symmetric form on the lattice (a function).

• `prec` – precision vector for the quantum affine plane.

`total`(I=None)[source]

Total invariant, meaning the stacky invariant for the trivial stability.

EXAMPLE:

```sage: from msinvar import *
sage: Q=JordanQuiver(1); Q # Quivers inherit from WCS
Jordan quiver: Quiver with 1 vertices and 1 arrows
sage: Q.prec([2]); # set precision vector
sage: I=Q.total(); I.poly()
1 + (y^2/(y^2 - 1))*x + (y^6/(y^6 - y^4 - y^2 + 1))*x^2
sage: I.Log().poly()
(y^2/(y^2 - 1))*x
```
`rank`()[source]
`sform`(a, b)[source]
`total_default`()[source]
`twist`(a, b=None)[source]

Product twist for a pair of vectors or a list of vectors.

`twist_product`()[source]

Twist the product in the quantum affine plane using `twist()`.

`untwist_product`()[source]

Untwist the product in the quantum affine plane (make it commutative).

`prec`(d=None)[source]

Set or return precision vector for the quantum affine plane.

`stacky`(z, I=None, algo='fast')[source]

Stacky invariant for the stability `z`.

See `total2stacky_algo1()` for more details. The value of `algo` can be ‘fast’, ‘fast2’, ‘slow’. If the total invariant `I` is None, we consider `total()`.

EXAMPLES:

```sage: from msinvar import *
sage: Q=KroneckerQuiver(2)
sage: Q.prec([5,5])
sage: z=Stability([1,0])
sage: I1=Q.stacky(z,algo='fast')
sage: I2=Q.stacky(z,algo='fast2')
sage: I1([1,1])
(y^2 + 1)/(y^2 - 1)
sage: I1.poly()-I2.poly()
0
```
`stacky_from_total`(*args, **kw)[source]

Alias for `stacky()`.

`Omh`(*args, **kw)[source]

Alias for `stacky()`.

`rat_from_total`(z, I=None, algo='fast')[source]

Return rational invariant for the stability `z`.

`Omb`(*args, **kw)[source]

Alias for `rat_from_total()`.

`int_from_total`(z, I=None, algo='fast')[source]

Return integer invariant for the stability `z`.

`Om`(*args, **kw)[source]

Alias for `int_from_total()`.

`stacky2total`(I, z)[source]
`stk2stk`(I, z, z1, algo='fast')[source]

Transform stacky invariant `I` for stability `z` to the stacky invariant for stability `z1`.

The value of `algo` can be ‘fast’ or ‘slow’.

`stk2rat`(I, z=None)[source]

Transform stacky invariant `I` to the rational invariant. By default we assume that `z` is a generic stability.

`rat2stk`(I, z=None)[source]

Transform rational invariant `I` to the stacky invariant. By default we assume that `z` is a generic stability.

`rat2int`(I)[source]

Transform rational invariant `I` to the integer invariant.

`int2rat`(I)[source]

Transform integer invariant `I` to the rational invariant.

`stk2int`(I)[source]

Transform stacky invariant `I` to the integer invariant. We assume that the stability parameter is generic.

`int2stk`(I)[source]

Transform integer invariant `I` to the stacky invariant. We assume that the stability parameter is generic.

`poly`(I, z=None, slope=None)[source]

Transform invariant `I` to a polynomial, considering only degrees having a given `slope` with respect to a given stability parameter `z`.

`series`(*args, **kw)[source]

Alias for `poly()`.

`eform`(a, b)[source]

Euler form of a quiver or a curve.

`twist_T`(d)[source]

Auxiliary term twist that depends on `eform()`.

`twist_TI`(d)[source]

Auxiliary term twist that depends on `eform()`.

`stable_from_stacky`(I)[source]

Count stable objects of a fixed slope, assuming that the stacky invariant `I` counting semistable objects of that slope is given. Based on arXiv:0708.1259.

`stable_from_total`(z, slope=0, I=None)[source]

Count `z`-stable representations having a given `slope`, assuming that the total invariant `I` is given. Based on arXiv:0708.1259.

• `z` – Stability parameter.

• `slope` – Slope value.

• `I` – Total invariant (if None, we consider `total()`).

`stable`(*args, **kw)[source]

Alias for `stable_from_total()`.

`simple`(I=None)[source]

Count simple reprentations of a quiver, assuming that the total invariant `I` is given. If `I` is None, we consider `total()`. Based on arXiv:0708.1259.

`self_stab`(d)[source]

Self-stability for the dimension vector `d`.

`attr_stab`(d)[source]

Attractor stability for the dimension vector `d`.

`stkAtt`(I=None)[source]

Calculate stacky attractor invariant assuming that the total invariant is `I`. If `I` is None, we consider `total()`.

`ratAtt`(I=None)[source]

Calculate rational attractor invariant assuming that the total invariant is `I`. If `I` is None, we consider `total()`.

`intAtt`(I=None)[source]

Calculate integer attractor invariant assuming that the total invariant is `I`. If `I` is None, we consider `total()`.

`OmhAtt`(I=None)

Calculate stacky attractor invariant assuming that the total invariant is `I`. If `I` is None, we consider `total()`.

`OmbAtt`(I=None)

Calculate rational attractor invariant assuming that the total invariant is `I`. If `I` is None, we consider `total()`.

`OmAtt`(I=None)

Calculate integer attractor invariant assuming that the total invariant is `I`. If `I` is None, we consider `total()`.

`stkAtt2total`(I=None)[source]

Calculate total invariant, assuming that the stacky attractor invariant is `I`. This is a recursive inversion of `stkAtt()`.

`ratAtt2total`(I=None)[source]

Calculate total invariant, assuming that the rational attractor invariant is `I`.

`intAtt2total`(I=None)[source]

Calculate total invariant, assuming that the integer attractor invariant is `I`.

`intAtt_default`()[source]
`ratAtt_default`()[source]
`stkAtt_default`()[source]
`attr_tree_formula`(z, I, t=0)[source]
`flow_tree_formula`(z, I, **kw)[source]
`msinvar.wall_crossing.``WCS`
`msinvar.wall_crossing.``total2stacky_algo1`(W, I, z)[source]

Calculate stacky invariant for stability `z`, assuming that the total invariant is `I`.

• `W` – Wall-crossing structure,

• `I` – Invariant,

• `z`– Stability.

Based on arXiv:math/0204059 (5.5) and implementation by Pieter Belmans. Has comparable speed to `total2stacky_algo2()`.

`msinvar.wall_crossing.``total2stacky_algo2`(W, I, z)[source]

Calculate stacky invariant for stability `z`, assuming that the total invariant is `I`.

• `W` – Wall-crossing structure,

• `I` – Invariant,

• `z`– Stability.

Has comparable speed to `total2stacky_algo1()`.

`msinvar.wall_crossing.``stacky2total_algo1`(W, I, z)[source]

Calculate total invariant, assuming that the stacky invariant for stability `z` is `I`.

This algorithm is faster than `stacky2total_algo2()`.

• `W` – Wall-crossing structure,

• `I` – Invariant,

• `z`– Stability.

`msinvar.wall_crossing.``stacky2total_algo2`(W, I, z)[source]

Calculate total invariant, assuming that the stacky invariant for stability `z` is `I`.

This is a recursive inversion of `total2stacky_algo1()`. It is slower than `stacky2total_algo1()`.

• `W` – Wall-crossing structure,

• `I` – Invariant,

• `z`– Stability.