Ask Your Question
0

How do I add missing functions?

asked 2022-08-02 03:15:19 +0100

anonymous user

Anonymous

I am new to sagemath.

I followed the steps for installing sagemath 9.6 from:

sagemanifolds[DOT]obspm[DOT]fr/install_ubuntu[DOT]html

However, while testing out the included functions, I noticed that I do not have any height functions:

height(); local_height(); global_height(); archimedean_local_height(); non_archimedean_local_height();

etc.

How do I add these missing functions?

edit retag flag offensive close merge delete

Comments

Height of what object? Do you want to add functions locally in your code, or globally in next version of Sage?

Max Alekseyev gravatar imageMax Alekseyev ( 2022-08-04 12:29:29 +0100 )edit

locally in my code. it seems to be in Sage already, just not in my version

new2sage gravatar imagenew2sage ( 2022-08-09 02:31:35 +0100 )edit

You need to provide a minimal example illustrating the issue. See https://en.wikipedia.org/wiki/Minimal...

Max Alekseyev gravatar imageMax Alekseyev ( 2022-08-09 03:00:01 +0100 )edit

I started with

apt install sagemath apt install sagemath-doc

then followed the steps from the link in my question:

sudo apt install [...too large for comment...]

git clone --branch master https://github.com/sagemath/sage.git

cd sage/

make configure ./configure MAKE="make -j8" make

then deleted the first installed binary :

sudo rm /usr/bin/sage

then moved the new binary to my PATH:

sudo ln -sf $(pwd)/sage /usr/local/bin

sudo ln -sf $(pwd)/sage /usr/bin

When I run sage -v it says:

SageMath version 9.6, Release Date: 2022-05-15

yet I receive the errors listed in response to slelievre's answer

new2sage gravatar imagenew2sage ( 2022-08-09 03:24:24 +0100 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-08-04 22:47:14 +0100

slelievre gravatar image

The height functions you refer to are available as methods of some objects, rather than as functions in the global namespace.

To use them, first define an object of the appropriate class, giving it a name; then apply the method.

For instance, for a point on an elliptic curve, first define it, naming it P:

sage: E = EllipticCurve([0, 0, 0, -36, 0])
sage: P = E(-3, 9)

Then ask its heights:

sage: P.height()
0.888625874839619
sage: P.local_height(v=5)
0.000000000000000
sage: P.global_height()
2.19722457733622
sage: P.archimedean_local_height()
1.98723816350773
sage: P.non_archimedean_local_height()
-log(3)
edit flag offensive delete link more

Comments

thanks for the assist.

after defining the elliptic curve, and point, I receive the following errors:

P.height(): AttributeError: 'EllipticCurvePoint_finite_field' object has no attribute 'height'.

P.local_height(v=5): TypeError: must be over a number field or a number field order.

P.global_height(): NotImplementedError: not implemented for subschemes.

P.archimedean_local_height() is not present.

P.local_height_arch(): TypeError: local_height_arch() missing 1 required positional argument: 'i'.

P.local_height_arch(i=5): TypeError: must be over a number field or a number field order.

p = order of field.

P.local_height_arch(i=p): TypeError: must be over a number field or a number field order.

P.non_archimedean_local_height() is not present.

new2sage gravatar imagenew2sage ( 2022-08-09 02:31:05 +0100 )edit

I first installed either sage 9.2 or 9.0 first, then installed 9.6 over it if that helps troubleshooting

new2sage gravatar imagenew2sage ( 2022-08-09 02:51:40 +0100 )edit

Please make the code self-contained - add the definition of P.

Max Alekseyev gravatar imageMax Alekseyev ( 2022-08-09 17:30:53 +0100 )edit

edited for simpler version with same result:

p = 37

K = GF(p)

E = EllipticCurve(K,[0, 0, 0, -36, 0])

P = E(-3, 9)

P.height(): AttributeError: 'EllipticCurvePoint_finite_field' object has no attribute 'height'.

P.local_height(v=5): TypeError: must be over a number field or a number field order.

P.global_height(): NotImplementedError: not implemented for subschemes.

P.archimedean_local_height() is not present.

P.local_height_arch(i=p): TypeError: must be over a number field or a number field order.

P.non_archimedean_local_height():is not present

it seems once I add the Galois Field, the height functions don't apply.

is this correct?

new2sage gravatar imagenew2sage ( 2022-08-10 03:18:52 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2022-08-02 03:14:44 +0100

Seen: 293 times

Last updated: Aug 04 '22