Opened 12 years ago

Last modified 12 years ago

#9829 new enhancement

Implement implicitly multiplied output

Reported by: Mitesh Patel Owned by: William Stein
Priority: major Milestone:
Component: user interface Keywords:
Cc: Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges


With implicit_multiplication(True), we can enter expressions using spaces instead of * to separate multiplied subexpressions:

sage: var('x, y, z')
sage: implicit_multiplication(True)
sage: 3 x^4 y + 2 z sin(x z 3 y) - 3 y^2
3*x^4*y - 3*y^2 + 2*z*sin(3*x*y*z)

This works similarly for polynomials.

But it's not yet possible to set an option so that Sage automatically postparses the output to multiply implicitly. For example,

sage: R.<a,b,c> = QQ[]; R
Multivariate Polynomial Ring in a, b, c over Rational Field
sage: implicit_multiplication_output(True)    # not implemented!
sage: R.random_element()
1/7 a b - 1/4 a c - c^2 + c 

Ideally, we would be able to use the output in later inputs with little or no modification.

AskSage question (by me).

Change History (1)

comment:1 Changed 12 years ago by Mitesh Patel

See source:/sage/misc/ for the input transformation.

Note: See TracTickets for help on using tickets.