Giter Club home page Giter Club logo

regularsage's Introduction

This is some example code for regular temperament calculations
in sage (http://www.sagemath.org/).

Example session:

sage: load("regular.sage")
sage: marvel = [[19, 30, 44, 53, 66], [22, 35, 51, 62, 76], [31, 49, 72, 87, 107
....: ]]
sage: TE_complexity(prime_limit(11), marvel)
0.155663817581076
sage: TE_error(prime_limit(11), marvel)
0.000358912952067382
sage: TE_badness(prime_limit(11), marvel, 1/1200)
0.000141239727910669
sage: expand(Cangwu_badness(prime_limit(11), marvel, 1/1200, prec=None) - Quadra
....: tic_badness(prime_limit(11), marvel, 1/1200, prec=None))
0
sage: TE_generators(prime_limit(11), marvel)*1200
[14.0590944364153 18.0239676709297 17.3222631713724]
sage: TOPByMapping(prime_limit(11), marvel).optimal_generators()*1200
Long-step dual simplex will be used
[ 11.30885270680194 17.427536967152477 19.426925475896425]
sage: TOPByMapping(prime_limit(11), marvel).tuning_map()*1200
Long-step dual simplex will be used
[1200.5087044593806 1901.1487233733199  2785.132538688604 3370.0190018269454  4149.558114073434]
sage: odd_limit_minimax(11, marvel)*1200
Long-step dual simplex will be used
[13.010049463220229 18.792048524571307    17.399483634137]
sage: odd_limit_hermite_minimax(11, marvel)*1200
Long-step dual simplex will be used
[            1200.0 1900.5978803293156 2783.5994727926904]
sage: odd_limit_hermite_minimax(11, marvel)*1200
Long-step dual simplex will be used
[            1200.0 1900.5978803293156 2783.5994727926904]
sage: temper_out(225/224, 385/384) == matrix(marvel).hermite_form()
True
sage: %time all(badness_equivalence_proof(1, n+1) for n in range(1, 13))
CPU times: user 1min 16s, sys: 820 ms, total: 1min 17s
Wall time: 1min 6s
True
sage: %time all(badness_equivalence_proof(2, n+2) for n in range(7))
CPU times: user 53.6 s, sys: 300 ms, total: 53.9 s
Wall time: 41.6 s
True
sage: %time badness_equivalence_proof(3, 3)
CPU times: user 3.5 s, sys: 64.1 ms, total: 3.57 s
Wall time: 2.97 s
True
sage: %time badness_equivalence_proof(3, 4)
CPU times: user 9.76 s, sys: 56.1 ms, total: 9.81 s
Wall time: 7.09 s
True
sage: %time badness_equivalence_proof(3, 5)
CPU times: user 32.4 s, sys: 148 ms, total: 32.6 s
Wall time: 21.7 s
True
sage: %time badness_equivalence_proof(3, 6)
CPU times: user 1min 22s, sys: 252 ms, total: 1min 23s
Wall time: 53.9 s
True
sage: %time badness_equivalence_proof(3, 7)
CPU times: user 3min 12s, sys: 432 ms, total: 3min 12s
Wall time: 2min 11s
True
sage: %time all(badness_equivalence_simple_proof(1, n+1) for n in range(1, 20))
CPU times: user 26.7 s, sys: 264 ms, total: 27 s
Wall time: 25 s
True
sage: %time all(badness_equivalence_simple_proof(2, n+2) for n in range(10))
CPU times: user 47.9 s, sys: 280 ms, total: 48.2 s
Wall time: 41.8 s
True
sage: %time all(badness_equivalence_simple_proof(3, n+3) for n in range(5))
CPU times: user 41.5 s, sys: 160 ms, total: 41.6 s
Wall time: 36.3 s
True
sage: %time badness_equivalence_simple_proof(3, 7)
CPU times: user 23 s, sys: 60.1 ms, total: 23.1 s
Wall time: 19.6 s
True
sage: %time badness_equivalence_simple_proof(3, 8)
CPU times: user 1min 10s, sys: 156 ms, total: 1min 10s
Wall time: 53.8 s
True

regularsage's People

Contributors

x31eq avatar

Stargazers

Sintel avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.