Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to initialize the LWE instance using the initialize_from_LWE_instance function the SagaMath 10.4 #13

Open
hungrydonkey opened this issue Oct 22, 2024 · 0 comments

Comments

@hungrydonkey
Copy link

When I run the toy example in the README, it is broken.

Cell In[4], line 1
----> 1 A, b, dbdd = initialize_from_LWE_instance(DBDD, n, q, m, D_e, D_s)

File <string>:43, in initialize_from_LWE_instance(dbdd_class, n, q, m, D_e, D_s, diag, verbosity)

File <string>:30, in __init__(self, B, S, mu, u, verbosity, homogeneous, float_type, D, Bvol, circulant)

File <string>:323, in check_basis_consistency(B, D, Bvol)

File <string>:228, in logdet(M, exact)

File /usr/lib/python3.12/site-packages/sage/matrix/matrix1.pyx:674, in sage.matrix.matrix1.Matrix.numpy (build/cythonized/sage/matrix/matrix1.c:14076)()
    672         return sib.name('matrix')(self.base_ring(), entries)
    673 
--> 674 def numpy(self, dtype=None):
    675     """
    676     Return the Numpy matrix associated to this matrix.

TypeError: numpy() got an unexpected keyword argument 'copy'

After a debug, I think this is related to the code below.

if not exact:
MM = array(M, dtype=float)
_, l = slogdet(MM)
return l

Here is a potential fix.

    if not exact:
        MM = [list(i) for i in M]
        MM = array(MM, dtype=float)
        _, l = slogdet(MM)
        return l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant