###### tags: `pqc` `tutorial` `ntru` [索引](/oiLTvejNR0Cy4Ct-ydK-QQ) # SageMath操作 詳細指示請參考: https://doc.sagemath.org/html/en/installation/ 為了方便說明,這裡會使用東海的開放電腦教室來做示範。 ## 打開東海的ubuntu vmware開放電腦教室: 1. 前往 https://tvacs.thu.edu.tw/ 2. 登入後點選 3. 點右上角的三個點按扭,選"Open in Browser": 4. 等他跑完後,會出現類似這樣的畫面:  ## 打開Terminal: 1. 點左下角的點點圖案: 2. 找到"終端機"打開: ## 安裝SageMath: 1. 在終端機內打`sudo apt install sagemath -y`,然後Enter: 2. 如果有東西跳出來,通常是跟`sagemath`無關的,因此想辦法跳過然後讓安裝繼續。 3. 可能會跑一段時間,但跑完就好了。 ## SageMath簡易操作: 1. 安裝完後,在終端機內打`sage`,然後Enter,就可以進入SageMath的操作模式內了。 2. 使用方式跟Python Shell很像,下面有幾個例子可供參考: * 對$2^{128} - 1$做因數分解:  * 展開以$\Bbb Z$為係數的$(1+x)^{10}$:  * 給定正方形矩陣,算出行列式(determinant)跟反矩陣(inverse matrix): $$A = \begin{pmatrix} 1 & 2 & 3 \\ -1 & 3 & 4 \\ 2 & 2 & 3 \end{pmatrix} $$  * 因為SageMath是用Python寫成的,因此python的語法也是可以混合使用的: 
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up