conversion#

Conversion to and from pyintervalxt

surface_dynamics.interval_exchanges.conversion.iet_from_pyintervalxt(T, alphabet=None)#

Conversion from pyintervalxt

EXAMPLES:

sage: import pyintervalxt  # optional: gmpxxyy  # optional: pyintervalxt
sage: from surface_dynamics.interval_exchanges.conversion import iet_from_pyintervalxt
sage: perm = (int(1), int(0))
sage: T = pyintervalxt.IntervalExchangeTransformation((int(18), int(3)), perm)  # optional: gmpxxyy  # optional: pyintervalxt
sage: iet_from_pyintervalxt(T)  # optional: gmpxxyy  # optional: pyintervalxt
Interval exchange transformation of [0, 21[ with permutation
a b
b a

sage: from cppyy.gbl import mpz_class  # optional: gmpxxyy  # optional: pyintervalxt
sage: l1 = mpz_class(12384758375127328356724597182479485)  # optional: gmpxxyy  # optional: pyintervalxt
sage: l2 = mpz_class(571349847513463874558781940004928374)  # optional: gmpxxyy  # optional: pyintervalxt
sage: T = pyintervalxt.IntervalExchangeTransformation((l1, l2), perm)  # optional: gmpxxyy  # optional: pyintervalxt
sage: iet_from_pyintervalxt(T)  # optional: gmpxxyy  # optional: pyintervalxt
Interval exchange transformation of [0, 583734605888591187546058532203790336[ with permutation
a b
b a

sage: from cppyy.gbl import mpq_class  # optional: gmpxxyy  # optional: pyintervalxt
sage: l1 = mpq_class(1, 123847585)  # optional: gmpxxyy  # optional: pyintervalxt
sage: l2 = mpq_class(4928374, 3)  # optional: gmpxxyy  # optional: pyintervalxt
sage: T = pyintervalxt.IntervalExchangeTransformation((l1, l2), perm)  # optional: gmpxxyy  # optional: pyintervalxt
sage: iet_from_pyintervalxt(T)  # optional: gmpxxyy  # optional: pyintervalxt
Interval exchange transformation of [0, 610367217876793/371542755[ with permutation
a b
b a

sage: from pyeantic.real_embedded_number_field import RealEmbeddedNumberField  # optional: pyeantic  # optional: pyintervalxt
sage: x = polygen(QQ)
sage: K.<sqrt2> = NumberField(x^2 - 2, embedding=AA(2).sqrt())
sage: L = RealEmbeddedNumberField(K)  # optional: pyeantic  # optional: pyintervalxt
sage: l1 = L(sqrt2).renf_elem  # optional: pyeantic  # optional: pyintervalxt
sage: l2 = L(4*sqrt2 - 3).renf_elem  # optional: pyeantic  # optional: pyintervalxt
sage: T = pyintervalxt.IntervalExchangeTransformation((l1, l2), perm)  # optional: pyeantic  # optional: pyintervalxt
sage: iet_from_pyintervalxt(T)  # optional: pyeantic  # optional: pyintervalxt
Interval exchange transformation of [0, 5*sqrt2 - 3[ with permutation
a b
b a
surface_dynamics.interval_exchanges.conversion.iet_to_pyintervalxt(T)#

Return the pyintervalxt version of the interval exchange transformation T.

EXAMPLES:

sage: from surface_dynamics import iet
sage: from surface_dynamics.interval_exchanges.conversion import iet_to_pyintervalxt
sage: p = iet.Permutation("a b c", "c b a")

Over integers:

sage: T = iet.IntervalExchangeTransformation(p, [12, 5, 9])
sage: T.base_ring()
Integer Ring
sage: iet_to_pyintervalxt(T)  # optional: gmpxxyy  # optional: pyintervalxt
...[a: 12] [b: 5] [c: 9] / [c] [b] [a]

Over rationals:

sage: T = iet.IntervalExchangeTransformation(p, [12/5, 2/7, 1/21])
sage: T.base_ring()
Rational Field
sage: iet_to_pyintervalxt(T)  # optional: gmpxxyy  # optional: pyintervalxt
[a: 12/5] [b: 2/7] [c: 1/21] / [c] [b] [a]

Over number fields:

sage: x = polygen(QQ)
sage: K.<sqrt2> = NumberField(x^2 - 2, embedding=AA(2).sqrt())
sage: T = iet.IntervalExchangeTransformation(p, [1, sqrt2, sqrt2-1])
sage: T = iet_to_pyintervalxt(T)  # optional: pyeantic  # optional: pyintervalxt  # random output due to deprecation warnings from cppyy
sage: T  # optional: pyintervalxt
[a: 1] [b: (sqrt2 ~ 1.4142136)] [c: (sqrt2-1 ~ 0.41421356)] / [c] [b] [a]
surface_dynamics.interval_exchanges.conversion.lengths_to_sage(lengths)#