Skip to content

Instantly share code, notes, and snippets.

View saschatimme's full-sized avatar
💭

Sascha Timme saschatimme

💭
View GitHub Profile
@saschatimme
saschatimme / codegen.md
Created August 31, 2020 18:40
HomotopyContinuation.jl codegen

I demonstrate what I mean with this using HomotopyContinuation.jl.

using HomotopyContinuation
@var x
f = System([4*x^4+3*x^3+2*x^2+x-5])

Given a symbolic system of polynomials f, in HC.jl there are two ways to optimize them for numerical evaluation. First the expression is optimized with similar techniques as you do (common subexpression elimination and then a simple multivariate horner-schema).

@saschatimme
saschatimme / icms2020-software-demo.ipynb
Last active July 12, 2020 20:54
HomotopyContinuation.jl Demo for ICMS 2020
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
travis_fold:start:worker_info
Worker information
hostname: 85ba6842-2cef-419a-809f-68f02283f5f0@1.worker-com-f6b8745bf-w46q6.gce-production-1
version: v6.2.8 https://github.com/travis-ci/worker/tree/6d3048d96b26562be21fa1a8b8144f4c4cecd083
instance: travis-job-23cd00ff-a16f-4bf1-b6f7-a74a07477add travis-ci-ubuntu-1804-1582576938-a9b1ae58 (via amqp)
startup: 6.156089633s
travis_fold:end:worker_info
travis_time:start:0f082b00
travis_time:end:0f082b00:start=1583758885827849268,finish=1583758886023735190,duration=195885922,event=no_world_writable_dirs
travis_time:start:3ada5d08
using HomotopyContinuation, LinearAlgebra
@polyvar x y z p[1:3]
F = [
x + 3 + 2y + 2 * y^2 - p[1],
(x - 2 + 5y) * z + 4 - p[2] * z,
(x + 2 + 4y) * z + 5 - p[3] * z,
]
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
parsePolynomial = p -> replace("ii","im",replace("p[0-9]+","0",toExternalString p))
writeSystem = method(Options=>{})
writeSystem (List, File) := o -> (P,f) -> (
R := ring first P;
vars := apply(gens R, toString);
concatenate(mingle(vars, (#vars-1):1));
f << "# This file was auto generated from Macaulay2.\n";
f << "# For more information about HomotopyContinuation.jl visit:\n";
f << "# https://www.JuliaHomotopyContinuation.org\n";
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.