SageMath
| 개발자 | 윌리엄 A. 스타인 |
|---|---|
| 발표일 | 2005년 2월 24일 |
| 안정화 버전 | 10.9
/ 2026년 5월 5일 |
| 저장소 | https://github.com/sagemath/sage |
| 프로그래밍 언어 | 파이썬, 사이썬, C, C++, 포트란 |
| 운영 체제 | 리눅스, 마이크로소프트 윈도우, macOS |
| 라이선스 | GPLv3 |
| 웹사이트 | www.sagemath.org |
SageMath(과거 명칭: Sage 또는 SAGE, "System for Algebra and Geometry Experimentation"[1])는 대수학, 조합론, 그래프 이론, 수치해석, 수론, 미적분학, 통계학 등 수학의 다양한 분야의 기능을 갖춘 컴퓨터 대수학 시스템이다.
SageMath의 첫 버전은 2005년 2월 24일 GNU 일반 공중 사용 허가서를 따르는 오픈 소스 자유 소프트웨어로 배포되었다.[2] SageMath는 마그마, 메이플, 매스매티카, MATLAB을 대체하는 오픈 소스 소프트웨어를 개발하는 것을 목적으로 개발되었다.
사용 예제
대수 및 미적분
x, a, b, c = var('x, a, b, c')
# Note that IPython also supports a faster way to do this, by calling
# this equivalent expression starting with a comma:
# ,var x a b c
log(sqrt(a)).simplify_log() # returns 1/2*log(a)
log(a / b).expand_log() # returns log(a) - log(b)
sin(a + b).simplify_trig() # returns sin(a)*cos(b) + sin(b)*cos(a)
cos(a + b).simplify_trig() # returns -sin(a)*sin(b) + cos(a)*cos(b)
(a + b)^5 # returns (a + b)^5
expand((a + b) ^ 5) # a^5 + 5*a^4*b + 10*a^3*b^2 + 10*a^2*b^3 + 5*a*b^4 + b^5
limit((x ^ 2 + 1) / (2 + x + 3 * x ^ 2), x=Infinity) # returns 1/3
limit(sin(x) / x, x=0) # returns 1
diff(acos(x), x) # returns -1/sqrt(-x^2 + 1)
f = exp(x) * log(x)
f.diff(x, 3) # returns e^x*log(x) + 3*e^x/x - 3*e^x/x^2 + 2*e^x/x^3
solve(a * x ^ 2 + b * x + c, x) # returns [x == -1/2*(b + sqrt(-4*a*c + b^2))/a,
# x == -1/2*(b - sqrt(-4*a*c + b^2))/a]
f = x ^ 2 + 432 / x
solve(f.diff(x) == 0, x) # returns [x == 3*I*sqrt(3) - 3,
# x == -3*I*sqrt(3) - 3, x == 6]
미분 방정식
t = var('t') # define a variable t
x = function('x')(t) # define x to be a function of that variable
de = (diff(x, t) + x == 1)
desolve(de, [x, t]) # returns (c + e^t)*e^(-t)
선형 대수
A = matrix([[1, 2, 3], [3, 2, 1], [1, 1, 1]])
y = vector([0, -4, -1])
A.solve_right(y) # returns (-2, 1, 0)
A.eigenvalues() # returns [5, 0, -1]
B = matrix([[1, 2, 3], [3, 2, 1], [1, 2, 1]])
B.inverse() # returns
[ 0 1/2 -1/2]
[-1/4 -1/4 1]
[ 1/2 0 -1/2]
# same matrix, but over the ring of doubles (not rationals, as above)
sage: B = matrix(RDF, [[1, 2, 3], [3, 2, 1], [1, 2, 1]])
sage: B.inverse()
[-5.55111512313e-17 0.5 -0.5]
[ -0.25 -0.25 1.0]
[ 0.5 0.0 -0.5]
# The Moore-Penrose pseudo-inverse
sage: C = matrix([[1 , 1], [2 , 2]])
sage: C.pseudoinverse()
[1/10 1/5]
[1/10 1/5]
# Alternatively, call NumPy for the pseudo-inverse
# (only numerical)
import numpy
C = matrix([[1 , 1], [2 , 2]])
matrix(numpy.linalg.pinv(C)) # returns
[0.1 0.2]
[0.1 0.2]
정수론
prime_pi(1000000) # returns 78498, the number of primes less than one million
E = EllipticCurve('389a') # construct an elliptic curve from its Cremona label
P, Q = E.gens()
7 * P + Q # returns (24187731458439253/244328192262001 :
# 3778434777075334029261244/3819094217575529893001 : 1)
sage: E2 = EllipticCurve(CC, [0,0,-2,1,1])
sage: E2
Elliptic Curve defined by y^2 + (-2.00000000000000)*y =
x^3 + 1.00000000000000*x + 1.00000000000000 over
Complex Field with 53 bits of precision
sage: E2.j_invariant()
61.7142857142857
가환대수
sage: P.<x, y, z> = PolynomialRing(QQ) # polynomial ring in x, y, z over the rationals
sage: (x**3 + y**3 + z**3 - 3*x*y*z).factor()
(x + y + z) * (x^2 - x*y + y^2 - x*z - y*z + z^2)
sage: I = P.ideal(x**2, x*y - y**2) # ideals defined by generators
sage: I.groebner_basis()
[y^3, x^2, x*y - y^2]
같이 보기
각주
- ↑ Stein, William. “SAGE: A Computer System for Algebra and Geometry Experimentation”. 2012년 3월 30일에 확인함.
- ↑ Stein, William (2007년 6월 12일). “Sage Days 4” (PDF). 2007년 6월 27일에 원본 문서 (PDF)에서 보존된 문서. 2007년 8월 2일에 확인함.
외부 링크
위키미디어 공용에 SageMath 관련 미디어 분류가 있습니다.- SageMath 공식 홈페이지
- SageMath 웹 인터페이스
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.