# Bundles

We try to keep the same syntax for AbsBundle and TnBundle. Note that not all methods are available for TnBundle.

## Construct bundles

IntersectionTheory.bundleFunction
bundle(X::AbsVariety, ch)
bundle(X::AbsVariety, r, c)

Construct a bundle on $X$ by specifying its Chern character, or its rank and total Chern class.

source
IntersectionTheory.OOFunction
OO(X::AbsVariety)
OO(X::TnVariety)

Return the trivial bundle $\mathcal O_X$ on $X$.

source
OO(X::AbsVariety, n)
OO(X::AbsVariety, D)

Return the line bundle $\mathcal O_X(n)$ on $X$ if $X$ has been given a polarization, or a line bundle $\mathcal O_X(D)$ with first Chern class $D$.

source

### Examples

julia> OO(proj(2))
AbsBundle of rank 1 on AbsVariety of dim 2

julia> bundles(grassmannian(2, 4))
2-element Vector{IntersectionTheory.AbsBundle}:
AbsBundle of rank 2 on AbsVariety of dim 4
AbsBundle of rank 2 on AbsVariety of dim 4

julia> bundles(grassmannian(2, 4, bott=true))
2-element Vector{IntersectionTheory.TnBundle}:
TnBundle of rank 2 on TnVariety of dim 4
TnBundle of rank 2 on TnVariety of dim 4

julia> tangent_bundle(variety(3))
AbsBundle of rank 3 on AbsVariety of dim 3

## Characteristic classes

IntersectionTheory.chiFunction
chi(F::AbsBundle)
chi(F::AbsBundle, G::AbsBundle)

Compute the holomorphic Euler characteristic $\chi(F)$, or the Euler pairing $\chi(F,G)$.

source
Note

For a TnBundle of rank $r$, since there are no Chow ring present, its Chern classes are represented as formal polynomials in $r$ variables. Arithmetics are only available for Chern classes of a same TnBundle. See examples below.

### Examples

For AbsBundle.

julia> X, (F,) = variety(2, [2=>"c"]);

julia> ch(F)
2 + c₁ + 1//2*c₁^2 - c₂

julia> chern(F)
1 + c₁ + c₂

julia> pontryagin(F)
1 + c₁^2 - 2*c₂

julia> chern(proj(2))
1 + 3*h + 3*h^2

julia> chern(2, proj(2))
3*h^2

julia> todd(proj(2))
1 + 3//2*h + h^2

julia> chi(cotangent_bundle(proj(2)))
-1

julia> G = grassmannian(2, 4); S, Q = bundles(G);

julia> chern(1, S)
c₁

julia> integral(chern(1, S)^4)
2

julia> chern(1, S) * chern(2, Q)
c₁*c₂

For TnBundle.

julia> G = grassmannian(2, 4, bott=true); S, Q = bundles(G);

julia> chern(1, S)
Chern class c₁ of TnBundle of rank 2 on TnVariety of dim 4

julia> integral(chern(1, S)^4)
2

julia> chern(1, S) * chern(2, Q) # this will not work
ERROR: AssertionError: a.F == b.F