Compare commits

...

8 Commits

2 changed files with 90 additions and 8 deletions

85
README.md Normal file
View File

@ -0,0 +1,85 @@
This repository contains code for computations in [Certifying Numerical Estimates of Spectral Gaps](https://arxiv.org/abs/1703.09680).
# Installing
To run the code You need `julia-v0.5` (should work on `v0.6`, but with warnings).
You also need to install julia packages: `Nemo-v0.6.3`, `ArgParse`. To do so in `julia`'s REPL run:
```julia
Pkg.update()
Pkg.add("Nemo")
Pkg.add("ArgParse")
```
Then clone the main repository of `Groups.jl`, `GroupRings.jl` and `PropertyT.jl`:
```julia
Pkg.clone("https://git.wmi.amu.edu.pl/kalmar/Groups.jl.git")
Pkg.clone("https://git.wmi.amu.edu.pl/kalmar/GroupRings.jl.git")
Pkg.clone("https://git.wmi.amu.edu.pl/kalmar/PropertyT.jl.git")
Pkg.resolve()
```
This should resolve all dependencies (e.g. install `JuMP`, `SCS`, `IntervalArithmetic`, `JLD`, `Memento`). Exit julia and finally clone this repository:
```shell
git clone https://git.wmi.amu.edu.pl/kalmar/GroupsWithPropertyT.git
cd GroupswithPropertyT
```
# Running
To check that $\Delta^2-\lambda\Delta$ is not decomposable to a sum of hermitian squares of elements in the ball of radius $2$ in $SL(2,7)$ run
```shell
julia SL.jl -N 2 -p 7 --radius 2 --iterations 100000
```
(~30 seconds, depending on hardware). The monotonous decreasing $\lambda$ during the optimisation is in column `pri obj` (or `dua obj`) of `solver.log`.
Compare this to
```shell
julia SL.jl -N 2 -p 7 --radius 3 --iterations 100000
```
which finds $\lambda \geq 0.5857$ and decomposes $\Delta^2-\lambda\Delta$ into sum of $47$ hermitian squares in less than 20 seconds (including certification).
If You see in the output (or in `full.log`) that the upper end of the interval where $\lVert\Delta^2 - \lambda\Delta - \sum{\xi_i}^*\xi_i\rVert_1$ belongs to is too large (resulting in positive `Floating point distance`, but negative `The Augmentation-projected actual distance`), decrease the `--tol` parameter, e.g.
```
julia SL.jl -N 2 -p 7 --radius 3 --iterations 100000 --tol 1e-9
```
to achieve a better estimate (the residuals $\ell_1$-norm should be around $\|B_d(e))\|*tol$)
# Help
```shell
julia SL.jl --help
usage: SL.jl [--tol TOL] [--iterations ITERATIONS]
[--upper-bound UPPER-BOUND] [--cpus CPUS] [-N N] [-p P]
[--radius RADIUS] [-h]
optional arguments:
--tol TOL set numerical tolerance for the SDP solver
(type: Float64, default: 1.0e-6)
--iterations ITERATIONS
set maximal number of iterations for the SDP
solver (default: 20000) (type: Int64, default:
50000)
--upper-bound UPPER-BOUND
Set an upper bound for the spectral gap (type:
Float64, default: Inf)
--cpus CPUS Set number of cpus used by solver (type:
Int64)
-N N Consider elementary matrices EL(N) (type:
Int64, default: 2)
-p P Matrices over field of p-elements (p=0 => over
ZZ) (type: Int64, default: 0)
--radius RADIUS Radius of ball B_r(e,S) to find solution over
(type: Int64, default: 2)
-h, --help show this help message and exit
```
# Specific version of the article
To checkout the specific versions of packages used for [Certifying Numerical Estimates of Spectral Gaps](https://arxiv.org/abs/1703.09680) run (inside the cloned `GroupswithPropertyT`)
```shell
git checkout 1703.09680v1
```
Unfortunately: You need to link `~/.julia/v0.5/GroupRings` to `~/.julia/v0.5/GroupAlgebras` due to change in the name of the package. Then run in `julia`
```julia
Pkg.checkout("GroupRings", "1703.09680v1")
Pkg.checkout("PropertyT", "1703.09680v1")
Pkg.resolve()
```

13
SL.jl
View File

@ -55,21 +55,18 @@ function products{T}(U::AbstractVector{T}, V::AbstractVector{T})
end end
function ΔandSDPconstraints(Id, S, radius) function ΔandSDPconstraints(Id, S, radius)
radius *=2
sizes = Vector{Int}() sizes = Vector{Int}()
S = vcat([Id], S) S = vcat([Id], S)
B = S B = S
push!(sizes,length(B)) push!(sizes,length(B))
for i in 2:radius for i in 2:2*radius
B = products(S, B); B = products(S, B);
push!(sizes, length(B)) push!(sizes, length(B))
end end
println("Generated balls of sizes $sizes") println("Generated balls of sizes $sizes")
k = div(radius,2) basis = B[1:sizes[radius]]
basis = B[1:sizes[k]]
product_matrix = PropertyT.create_product_matrix(B, sizes[k]); product_matrix = PropertyT.create_product_matrix(B, sizes[radius]);
sdp_constraints = PropertyT.constraints_from_pm(product_matrix, length(B)) sdp_constraints = PropertyT.constraints_from_pm(product_matrix, length(B))
L_coeff = PropertyT.splaplacian_coeff(S, basis, length(B)); L_coeff = PropertyT.splaplacian_coeff(S, basis, length(B));
Δ = GroupAlgebraElement(L_coeff, product_matrix) Δ = GroupAlgebraElement(L_coeff, product_matrix)
@ -153,7 +150,7 @@ function main()
end end
radius = parsed_args["radius"] radius = parsed_args["radius"]
if radius == 0 if radius == 0
name*"-$(string(upper_bound))" name = name*"-$(string(upper_bound))"
radius = 2 radius = 2
else else
name = name*"-$(string(upper_bound))-r=$radius" name = name*"-$(string(upper_bound))-r=$radius"
@ -164,7 +161,7 @@ function main()
if parsed_args["cpus"] > cpuinfo_physicalcores() if parsed_args["cpus"] > cpuinfo_physicalcores()
warn("Number of specified cores exceeds the physical core cound. Performance will suffer.") warn("Number of specified cores exceeds the physical core cound. Performance will suffer.")
end end
Blas.set_num_threads(parsed_args["cpus"]) BLAS.set_num_threads(parsed_args["cpus"])
end end
@time PropertyT.check_property_T(name, S, solver, upper_bound, tol, radius) @time PropertyT.check_property_T(name, S, solver, upper_bound, tol, radius)
return 0 return 0