Skip to content
Snippets Groups Projects
Commit bfc72f45 authored by Maximilian Stauss's avatar Maximilian Stauss
Browse files

add sage extensions

parent 19c99c04
No related branches found
No related tags found
No related merge requests found
from __future__ import absolute_import
from sage.all import random_matrix, random_vector, random
def random_invertible_matrix(finite_field, n):
matrix = random_matrix(finite_field, n)
while not matrix.is_invertible():
matrix = random_matrix(finite_field, n)
return matrix
def random_value(finite_field):
return random_vector(finite_field, 1)[0]
def random_between(j, k):
a = int(random() * (k - j + 1)) + j
return a
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment