Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View mforets's full-sized avatar
🏠
Working from home

Marcelo Forets mforets

🏠
Working from home
View GitHub Profile
@mforets
mforets / dict2xml.py
Created October 20, 2016 10:05
Convert Python dictionaries into XML
r"""Convert Python dictionaries into XML.
AUTHORS:
- Marcelo Forets
EXAMPLES:
python: d = list()
python: d.append({'id':1, 'text':'foo'})
@mforets
mforets / residues.md
Last active May 7, 2017 17:52
residue calculus: exploring (non-commercial) complex variable features available through SageMath
sage: z = SR.var('z', domain='complex')
sage: k = SR.var('k', domain='integer')
sage: giac('assume(k, integer)')  # for Giac PExpect interface
@mforets
mforets / gitignore
Created July 5, 2017 07:20
gitignore
## System specifics
*.DS_Store
## Core latex/pdflatex auxiliary files:
*.aux
*.lof
*.log
*.lot
*.fls
*.out
@mforets
mforets / julia.py
Created August 23, 2017 16:22
Sagemath interface to Julia interpreter
r"""
Interface to Julia interpreter.
Julia is a high-level, high-performance dynamic programming language for
numerical computing, see the official website <JuliaLang https://julialang.org/>_
for installation and further information.
The commands in this section only work if you have "julia" installed and
available in your PATH. It's not necessary to install any special Sage packages.
@mforets
mforets / benchs_chbv.md
Last active October 27, 2017 09:50
Benchmark of chbv.jl implementations

see PR #16 in Expokit.jl.

data

the different implementations were tested on a fixed set of 8 hermitian negative semidefinite matrices the were randomly generated. the MAT file is available here.

the functions to generate the matrices were:

@mforets
mforets / integrals.md
Last active April 19, 2018 15:45
a bunch of integrals: exploring (non-commercial) symbolic integrators available through SageMath
sage: integrate(exp(-x)*sinh(sqrt(x)), x, 0, oo, algorithm='maxima').simplify() # ok
1/4*(sqrt(pi)*(erf(1) - 1) + sqrt(pi) + 2*e^(-1) - 2)*e^(1/4) - 1/4*(sqrt(pi)*(erf(1) - 1) - sqrt(pi) + 2*e^(-1) - 2)*e^(1/4)
sage: _.canonicalize_radical()
1/2*sqrt(pi)*e^(1/4)
sage: integrate(exp(-x)*sinh(sqrt(x)), x, 0, oo, algorithm='giac').simplify() # ok, fast
1/2*sqrt(pi)*e^(1/4)
sage: integrate(exp(-x)*sinh(sqrt(x)), x, 0, oo, algorithm='sympy') # ok, fast, reduced

How to checkout a branch from a fork

$ git ls-remote --refs origin
0b3fd8db7f46c08920ba2071e1fd54ab3d8b156b        refs/heads/binder_no_glpk
122b696148bd24d0dbfa8c74067d51c4dd480831        refs/heads/gh-pages
...
92042c569369aa88179354cf62561fba169141c6        refs/pull/610/head
585743f6c5ba7456bc4b08026f14cbd4dfa84527        refs/pull/610/merge
67426ec1375627f7c2e28d9767301383b67173ba refs/tags/v1.4.0
@mforets
mforets / expm_bench.md
Last active November 12, 2018 22:26
expmv and expv benchs
julia> versioninfo()
Julia Version 0.7.0
Commit a4cb80f3ed (2018-08-08 06:46 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin14.5.0)
  CPU: Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.0 (ORCJIT, haswell)
@mforets
mforets / bibliography.bib
Created November 16, 2018 14:17
bibliography
@inproceedings{ARCH18:nonlinear,
author = {Fabian Immler and Matthias Althoff and Xin Chen and Chuchu Fan and Goran Frehse and Niklas Kochdumper and Yangge Li and Sayan Mitra and Mahendra Singh Tomar and Majid Zamani},
title = {ARCH-COMP18 Category Report: Continuous and Hybrid Systems with Nonlinear Dynamics},
booktitle = {ARCH18},
@volume = {54},
pages = {53--70},
year = {2018},
@publisher = {EasyChair},
@url = {https://easychair.org/publications/paper/gjfh},
@doi = {10.29007/mskf}
@mforets
mforets / intersectionCPA.md
Last active February 4, 2019 16:24
intersection of CPA and unbdd set
function intersection(X::CartesianProductArray{N},
                      Y::AbstractPolyhedron{N}) where {N}

    # preallocate the resulting CartesianProductArray with size hint
    result = CartesianProductArray(length(X), N)

    if isbounded(Y)
        # no free variables
 free_variables = []