Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ makedocs(;
"UniversalBundles" => "api/universal_bundles.md",
"Cohomology" => "api/cohomology.md",
"Projections" => "api/projections.md",
"Hodge & Hochschild" => "api/hodge.md",
"Hodge, Betti & Hochschild" => "api/hodge.md",
"ZeroLoci" => "api/zero_loci.md",
"Koszul Algebra" => "api/koszul.md",
"Constructions" => "api/constructions.md",
Expand Down
12 changes: 10 additions & 2 deletions docs/src/api/hodge.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Hodge & Hochschild
# Hodge, Betti & Hochschild

Hodge numbers, twisted Hodge numbers, and Hochschild cohomology.
Hodge numbers, Betti numbers, twisted Hodge numbers, and Hochschild cohomology.

See the [mathematical background](../math.md#Hochschild-cohomology-of-zero-loci) for a detailed
description of the algorithm, including why both twisted Hodge matrices ``M_1`` and ``M_2``
Expand Down Expand Up @@ -29,6 +29,14 @@ twisted_hodge_numbers
print_hodge_diamond
```

## Betti numbers

[`betti_numbers`](@ref) returns a zero-based vector of all Betti numbers,
with `b[k]` equal to ``b_k(X)`` for `k` in `0:2*dimension(X)`.
For a partial flag variety, odd entries vanish.
For a smooth zero locus, the entries are sums of Hodge numbers with fixed total degree;
any unresolved parameters are retained as [`AffineExpr`](@ref)s.

## Hochschild cohomology

The Hochschild–Kostant–Rosenberg decomposition gives
Expand Down
4 changes: 2 additions & 2 deletions docs/src/conventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ Cohomological indices start at zero:
3. The Hochschild [`PolyvectorParallelogram`](@ref) is **0-indexed**:
`P[p, q]` is ``\mathrm{h}^q(X, \bigwedge\nolimits^p \mathrm{T}_X)`` and `P[n]` is
``\dim \mathrm{HH}^n``.
4. [`betti_numbers`](@ref) returns a **zero-based** vector containing only even degrees.
For `b = betti_numbers(X)`, `b[p]` is ``b_{2p}(X)``, with indices `0:dimension(X)`.
4. [`betti_numbers`](@ref) returns a **zero-based** vector containing all cohomological degrees.
For `b = betti_numbers(X)`, `b[k]` is ``b_k(X)``, with indices `0:2*dimension(X)`.

For example:

Expand Down
39 changes: 13 additions & 26 deletions examples/FanoFourfolds.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const BATCH_SIZE = parse(

@everywhere begin
using PartialFlagVarieties
using OffsetArrays: OffsetMatrix
using JSON

const WORKER_GC_EVERY = parse(Int, get(ENV, "FANO4_WORKER_GC_EVERY", "16"))
Expand Down Expand Up @@ -236,26 +237,21 @@ const BATCH_SIZE = parse(
Fills by Serre duality h^{p,q} = h^{d-p,d-q} for d=4.
"""
function parse_reference_hodge(hodge_data::Vector)
H = Matrix{AffineExpr}(undef, 5, 5)
for i in eachindex(H)
H[i] = AffineExpr(0)
end
known = falses(5, 5)
H = OffsetMatrix(fill(AffineExpr(0), 5, 5), 0:4, 0:4)
known = OffsetMatrix(falses(5, 5), 0:4, 0:4)

for (q, row) in enumerate(hodge_data)
for (p, val) in enumerate(row)
H[p, q] = parse_hodge_value(val)
known[p, q] = true
H[p - 1, q - 1] = parse_hodge_value(val)
known[p - 1, q - 1] = true
end
end

# Fill by Serre duality: h^{p,q} = h^{d-p,d-q}
for p in 0:4, q in 0:4
pi, qi = p + 1, q + 1
sp, sq = 4 - p + 1, 4 - q + 1
if !known[pi, qi] && sp >= 1 && sq >= 1 && known[sp, sq]
H[pi, qi] = H[sp, sq]
known[pi, qi] = true
if !known[p, q] && known[4 - p, 4 - q]
H[p, q] = H[4 - p, 4 - q]
known[p, q] = true
end
end

Expand Down Expand Up @@ -309,7 +305,7 @@ const BATCH_SIZE = parse(
Returns `(matches, mapping)`.
"""
function find_variable_mapping(
computed::Matrix{AffineExpr}, reference::Matrix{AffineExpr}
computed::AbstractMatrix{AffineExpr}, reference::AbstractMatrix{AffineExpr}
)
c_var_set = Set{Int}()
r_var_set = Set{Int}()
Expand Down Expand Up @@ -390,15 +386,7 @@ const BATCH_SIZE = parse(
function ambient_hodge_numbers(X)
d = dimension(X)
d == 4 || error("ambient dimension $d != 4")
betti = betti_numbers(X)
H = Matrix{AffineExpr}(undef, 5, 5)
for i in eachindex(H)
H[i] = AffineExpr(0)
end
for p in 0:4
H[p + 1, p + 1] = AffineExpr(betti[p])
end
H
AffineExpr.(hodge_numbers(X))
end

# =============================================================================
Expand Down Expand Up @@ -452,8 +440,7 @@ const BATCH_SIZE = parse(
Z = zero_locus(E)

t_hodge = time_ns()
# The reference data uses ordinary one-based matrices.
H = parent(hodge_numbers_symbolic(Z))
H = hodge_numbers_symbolic(Z)
hodge_elapsed = (time_ns() - t_hodge) / 1e9

polyvector = maybe_compute_polyvector(Z)
Expand Down Expand Up @@ -492,13 +479,13 @@ end # @everywhere
# Pretty-print helpers
# =============================================================================

function format_hodge_matrix(H::Matrix{AffineExpr})
function format_hodge_matrix(H::AbstractMatrix{AffineExpr})
d = size(H, 1) - 1
lines = String[]
for q in 0:d
entries = String[]
for p in 0:d
push!(entries, sprint(show, H[p + 1, q + 1]))
push!(entries, sprint(show, H[p, q]))
end
push!(lines, join(entries, " "))
end
Expand Down
12 changes: 10 additions & 2 deletions src/Constructions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,15 @@ julia> dimension(V)
4

julia> betti_numbers(V)
5-element OffsetArray(::Vector{BigInt}, 0:4) with eltype BigInt with indices 0:4:
9-element OffsetArray(::Vector{BigInt}, 0:8) with eltype BigInt with indices 0:8:
1
0
1
0
1
0
1
0
1
```
"""
Expand Down Expand Up @@ -252,11 +256,15 @@ julia> dimension(V)
4

julia> betti_numbers(V)
5-element OffsetArray(::Vector{BigInt}, 0:4) with eltype BigInt with indices 0:4:
9-element OffsetArray(::Vector{BigInt}, 0:8) with eltype BigInt with indices 0:8:
1
0
1
0
2
0
1
0
1
```
"""
Expand Down
49 changes: 39 additions & 10 deletions src/Hodge.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,11 @@ function hodge_numbers(X::PartialFlagVariety)
betti = betti_numbers(X)

# For G/P: h^{p,q} = δ_{p,q} * b_{2p}
# betti_numbers returns only even Betti numbers: betti[p] = b_{2p}
H = zeros(BigInt, d + 1, d + 1)
for p in 0:min(d, length(betti) - 1)
H[p + 1, p + 1] = betti[p]
H = OffsetMatrix(zeros(BigInt, d + 1, d + 1), 0:d, 0:d)
for p in 0:d
H[p, p] = betti[2 * p]
end
OffsetArray(H, -1, -1)
H
end

# ═══════════════════════════════════════════════════════════════════════════════
Expand Down Expand Up @@ -123,7 +122,7 @@ function twisted_hodge_numbers(X::PartialFlagVariety, L::CompletelyReducibleBund
rank(L) == 1 || throw(ArgumentError("the twist must be a line bundle"))
d = dimension(X)
H = _filtered_hodge_matrix(d, p -> tensor_product(_filtered_cotangent_power(X, p), L))
OffsetArray(_collapse_determined(H), -1, -1)
OffsetMatrix(_collapse_determined(H), -1, -1)
end

function twisted_hodge_numbers(X::PartialFlagVariety, j::Integer)
Expand Down Expand Up @@ -401,7 +400,7 @@ function hodge_numbers(Z::ZeroLocus)
if n_factors(Z) >= 2
diamonds = map(hodge_numbers, factors(Z))
all(diamond -> all(is_determined, diamond), diamonds) &&
return OffsetArray(_kunneth_bigraded(parent.(diamonds)), -1, -1)
return OffsetMatrix(_kunneth_bigraded(parent.(diamonds)), -1, -1)
end

d = dimension(Z)
Expand All @@ -425,7 +424,7 @@ function hodge_numbers(Z::ZeroLocus)
# to the zero diamond explicitly (matching hochschild_cohomology, which already
# returns the zero parallelogram for an empty zero locus).
if is_determined(M[1, 1]) && M[1, 1].constant == 0
return OffsetArray(fill(AffineExpr(0), d + 1, d + 1), -1, -1)
return OffsetMatrix(fill(AffineExpr(0), d + 1, d + 1), -1, -1)
end

# The Lefschetz hyperplane theorem can pin down entries the long exact
Expand All @@ -439,7 +438,37 @@ function hodge_numbers(Z::ZeroLocus)
M[p + 1, q + 1] = M[d - p + 1, d - q + 1]
end

OffsetArray(_renumber_variables!(M), -1, -1)
OffsetMatrix(_renumber_variables!(M), -1, -1)
end

"""
betti_numbers(Z::ZeroLocus) -> OffsetVector{AffineExpr}

Return the Betti numbers ``b_k(Z) = \\dim \\mathrm{H}^k(Z, \\mathbb{Q})``
in all degrees, indexed by `0:2*dimension(Z)`.

Sum the entries of [`hodge_numbers`](@ref) with total degree ``k``:
``b_k(Z) = \\sum_{p+q=k} \\mathrm{h}^{p,q}(Z)``.
Entries are [`AffineExpr`](@ref)s, retaining any unresolved parameters.
As for Hodge numbers, this assumes a smooth zero locus of a regular section.

# Examples
```jldoctest
julia> using PartialFlagVarieties

julia> Z = zero_locus(line_bundle(projective_space(4), 3));

julia> b = betti_numbers(Z);

julia> b[3]
10
```
"""
function betti_numbers(Z::ZeroLocus)
H = hodge_numbers(Z)
d = dimension(Z)
b = [sum(H[p, k - p] for p in max(0, k - d):min(d, k)) for k in 0:(2 * d)]
OffsetVector(b, -1)
end

"""
Expand Down Expand Up @@ -963,7 +992,7 @@ function twisted_hodge_numbers(
Z::ZeroLocus, L::CompletelyReducibleBundle
)
M = _twisted_hodge_symbolic(Z, L, Ref(0))
OffsetArray(_renumber_variables!(M), -1, -1)
OffsetMatrix(_renumber_variables!(M), -1, -1)
end

"""
Expand Down
3 changes: 2 additions & 1 deletion src/PartialFlagVarieties.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module PartialFlagVarieties

using Semisimple
using LRUCache
using OffsetArrays: OffsetArray
using OffsetArrays: OffsetMatrix, OffsetVector
using Preferences
using PrettyTables
using StaticArrays
Expand Down Expand Up @@ -173,6 +173,7 @@ end
Z = zero_locus(L)
euler_characteristic(Z)
hodge_numbers(Z)
betti_numbers(Z)
end
end

Expand Down
19 changes: 11 additions & 8 deletions src/PartialFlagVariety.jl
Original file line number Diff line number Diff line change
Expand Up @@ -242,15 +242,15 @@ end
"""
betti_numbers(X::PartialFlagVariety) -> OffsetVector{BigInt}

Return the Betti numbers of `X` in even degrees, i.e.
``[b_0, b_2, b_4, \\ldots, b_{2d}]``.
Return the Betti numbers ``b_k(X) = \\dim \\mathrm{H}^k(X, \\mathbb{Q})``
in all degrees, indexed by `0:2*dimension(X)`.

Since ``\\mathrm{G}/\\mathrm{P}`` has no odd cohomology this completely describes ``\\mathrm{H}^\\bullet(X, \\mathbb{Z})``.
Computed from the ratio of the Poincaré polynomials of the Weyl groups
``\\mathrm{W}_{\\mathrm{G}}`` and ``\\mathrm{W}_{\\mathrm{L}}``.
The odd entries vanish for a partial flag variety.
The even entries are computed from the ratio of the Poincaré polynomials
of the Weyl groups ``\\mathrm{W}_{\\mathrm{G}}`` and ``\\mathrm{W}_{\\mathrm{L}}``.

The indices run from `0` to `dimension(X)`: the entry `b[p]` is ``b_{2p}``.
Use `parent(b)` to access the underlying one-based vector.
For `b = betti_numbers(X)`, `b[k]` is ``b_k(X)``.
Use `parent(b)` to access the underlying ordinary one-based vector.
"""
function betti_numbers(X::PartialFlagVariety)
degs_G = collect(degrees_fundamental_invariants(dynkin_type(X)))
Expand All @@ -262,7 +262,10 @@ function betti_numbers(X::PartialFlagVariety)

num = foldl((p, d) -> _poly_mul(p, ones(BigInt, d)), degs_G; init=BigInt[1])
den = foldl((p, d) -> _poly_mul(p, ones(BigInt, d)), degs_L; init=BigInt[1])
OffsetArray(_poly_div(num, den), -1)
even = _poly_div(num, den)
b = zeros(BigInt, 2 * length(even) - 1)
b[1:2:end] = even
OffsetVector(b, -1)
end

function _poly_mul(a, b)
Expand Down
Loading
Loading