Upgrade to Pro — share decks privately, control downloads, hide ads and more …

SageMathで数学の力を上げます PyCon mini Hiroshima 2019 / Enlarge your ability of mathematics with SageMath

北䑓如法
October 12, 2019

SageMathで数学の力を上げます PyCon mini Hiroshima 2019 / Enlarge your ability of mathematics with SageMath

SageMathで数学の力を上げます PyCon mini Hiroshima 2019 / Enlarge your ability of mathematics with SageMath
PyCon mini Hiroshima 2019 での講演資料です。
@広島市立大学サテライトキャンパス 2019年10月12日(土)

北䑓如法

October 12, 2019
Tweet

More Decks by 北䑓如法

Other Decks in Education

Transcript

  1. SageMathͰ ਺ֶͷ ྗΛ ্͛·͢ Enlarge your ability of mathematics with

    SageMath ๺㝳೗๏ PyCon mini Hiroshima 2019 @޿ౡࢢཱେֶαςϥΠτΩϟϯύε @2019೥10݄12೔(౔)
  2. (͜͜Ͱ࠷ۙͷଞͷ׆ಈΛը૾(ུ)෇͖Ͱ͝঺հͨ͠) ▸ ཆ໋ञ΢Σϒಈը޿ࠂ ެࣜwwwww ୈ26ճ೔ຊϓϩϞʔγϣϯاըίϯςετͰάϥ ϯϓϦ৆wwww ▸ όϑΝϦϯ ΢Σϒಈը޿ࠂ ެࣜwwwww

    ▸ ؟ڸࢢ৔ ެࣜww ςϨϏCM wwww ▸ ؟ڸࢢ৔ TVCM (2018) Χʔϓww Τϧwww ▸ ؟ڸࢢ৔ TVCM (2019) ϑϥϯεΞwwwwwww ▸ ࠓ೥ RCCதࠃ์ૹ(TBSܥ) ʰΠϚͳ·ͬ!ʱίϝϯςʔλwwww
  3. SageMathͰ ਺ֶͷ ྗΛ ্͛·͢ ͞ ͛ · ͢ ͋ ͛

    · ͢ ʊਓਓਓਓਓਓʊ ʼɹμδϟϨɹʻ ʉ̮̮̮̮̮̮ʉ
  4. Sage ▸ Φʔϓϯιʔεͷ਺ֶιϑτ΢ΣΞγεςϜ ▸ ͍ΖΜͳ਺ֶιϑτ΢ΣΞΛPythonͰ౷߹ ▸ GAP, Maxima, NumPy, SciPy,

    mathplotlib, Sympy, FLINT, R ▸ ϛογϣϯ: Mathematica ͱ͔ Maple, Matlab, Magmaͷ୅ସΛ࡞Δ͜ͱ
  5. ؆୯ʹࢼ͢ ▸ ΢Σϒ ▸ Sage Cell Server https://sagecell.sagemath.org/ ▸ CoCalc

    (چSageMathCloud) https://cocalc.com ▸ Πϯετʔϧ ▸ ϩʔΧϧʹ ▸ ίϚϯυϥΠϯͰ΋
  6. SageΛେֶͷतۀͰซ༻ ▸ ޿ౡେֶͷڭҭֶ෦Ͱ਺ֶΛڭ͍͑ͯΔ ▸ ୅਺ֶܥͷೖ໳ߨٛͷҰ෦ Sage Λ࢖༻ͨ͠ ▸ ڭҭֶ෦Ͱɺதɾߴͷ਺ֶՊͷڭһ໔ڐΛऔΖ͏ͱ͢Δֶੜ ▸

    ͕ͬͭΓϓϩάϥϛϯάΛ͢Δਓ޲͚Ͱ͸ͳ͍ ▸ ͪΐͬͱίϚϯυΛଧͬͯΈͯܭࢉͤ͞Δ͙Β͍Ͱे෼ศར ▸ ʮߴڃి୎ʯͱͯ͠
  7. ࠷େެ໿਺ ▸ ࠷େެ໿਺ greatest common divisor (GCD) ▸ (1) 12,

    18 ͷ࠷େެ໿਺͸? ▸ (2) 123456789 ͱ 987654321 ͷ࠷େެ໿਺͸? ▸ ΍Γํ ▸ ໿਺Λશ෦͍͋͛ͯ͘ ▸ ૉҼ਺෼ղͯ͠ڞ௨ͷૉҼ਺Λ͔͚Δ ▸ ϢʔΫϦουͷޓআ๏
  8. ପԁۂઢ ▸ (ॏࠜͳ͠) Ͱఆٛ͞ΕΔʮۂઢʯ ▸ ΋ͷ͘͢͝ݚڀ͞Ε͍ͯΔɻݱࡏ΋ɻ ▸ ਺ֶతʹ͘͢͝ັྗతͳର৅ ▸ ઌ΄Ͳͷ໰୊ͩͱɺ

    ▸ Λ ͱ͓͍ͨΒɺ ▸ ͱ͍͏ପԁۂઢͷ্ͷ֨ࢠ఺ (੔਺఺) (࠲ඪ͕੔਺ʹͳ͍ͬͯΔ ఺) (ͷ͏ͪ ͷ΋ͷ) ΛٻΊΔ໰୊ y2 = xͷ3࣍ࣜ 12502 + n3 y y2 = 12502 + n3 y2 = x3 + 12502 x > 0
  9. ପԁۂઢ ▸ ͷ஥ؒͨͪ y2 = x3 + 12502 -4 -2

    0 2 4 -4 -2 0 2 4 y2 = x3 − x -4 -2 0 2 4 -4 -2 0 2 4 y2 = x3 + 1
  10. ପԁۂઢ ▸ ͷ஥ؒͨͪ ▸ ͜Ε͸ ͕࣮਺Λಈ͍ͨਤ ▸ ͜ͷதͰ ͕ͱ΋ʹ੔਺ʹͳΔ఺Λ୳͢ ▸

    ࣮͸δʔήϧͷఆཧʮପԁۂઢͷ੔਺ղ͸ৗʹ༗ݶݸʯ y2 = x3 + 12502 x, y x, y -4 -2 0 2 4 -4 -2 0 2 4 y2 = x3 − x -4 -2 0 2 4 -4 -2 0 2 4 y2 = x3 + 1
  11. SageͰପԁۂઢΛѻ͏ ▸ Λ΍Δ ▸ Weierstrassํఔࣜ ͩͱ EllipticCurve([a1,a2,a3,a4,a6]) Ͱ࡞ΕΔɻ ▸ ͷ

    লུܗ: EllipticCurve([a4,a6]) ▸ E = EllipticCurve([0,0,0,0,1562500]) ▸ E.integral_points() y2 = x3 + 12502 y2 + a1 xy + a3 y = x3 + a2 x2 + a4 x + a6 a1 = a2 = a3 = 0
  12. SageͰପԁۂઢΛѻ͏ ▸ E.integral_points() ▸ [(-100 : 750 : 1),
 (0

    : 1250 : 1),
 (125 : 1875 : 1),
 (500 : 11250 : 1),
 (600 : 14750 : 1),
 (66500 : 17148750 : 1)] ▸ ౴͑ n = 125, 500, 600, 66500
  13. ͔͜͜Β͸͕࣌ؒ͋Ε͹͓·͚ ▸ scheme ͱ͔ generic point ͱ͔Ψνͷ୅਺زԿͷΫϥε΋༻ҙ͞Ε͍ͯ Δɻ ▸ Try:

    ݚڀͰ࢖͓͏ͱͯ͠։ൃʹߩݙ͍ͨ͠ͱ͜Ζ͕Ͱ͖ͯͨͷͰߩݙ͢Δ ▸ ྫ΋͏Ұͭ
  14. Python 3 ରԠͲ͏ͳͷ? ▸ ରԠ͍ͯ͠Δɻ ▸ Python3-compatible code - Sage

    Wiki https://wiki.sagemath.org/Python3-compatible%20code ࢀর ▸ ࠓޙ͸όΠφϦ΋ఏڙ༧ఆɻversion 8.8 ͷޙ͔ΒΒ͍͠ͷͰͦΖͦΖɻ ▸ CoCalcͰ͸ΧʔωϧͰબ΂·͢ɻ ▸ खಈϏϧυ͸
 $ make configure
 $ ./configure --with-python=3
 $ make build
 ͰOK
  15. ݱ୅਺ֶ΋͔ͳΓॆ࣮ ▸ scheme ͱ͔ generic point ͱ͔Ψνͷ୅਺زԿͷΫϥε΋༻ҙ͞Ε͍ͯΔ ▸ Points on

    projective varieties, Scheme morphism for points on projective varieties https:// github.com/sagemath/sage/blob/master/src/sage/schemes/projective/projective_point.py ▸ P = ProjectiveSpace(2, QQ) ←༗ཧ਺܎਺ͷࣹӨฏ໘͕͜ΕͰͰ͖Δ ▸ P(2, 3/5, 4) ←Pͷ্ͷ੪࣍࠲ඪ (2 : 3/5 : 4) ͷ఺ͷΦϒδΣΫτ͕͜ΕͰͰ͖Δ ▸ ࣹӨۭؒͷ఺ΛྻڍରԠʹ͔ͨͬͨ͠ɻ ▸ → ࠓޙ͸։ൃʹࢀՃ͍ͨ͠ɻ ▸ ChangeLog ΛݟΔͱ৽͍͠ίϯτϦϏϡʔλ͕ଟ਺!