Welcome to Cadabra Q&A, where you can ask questions and receive answers from other members of the community.
+1 vote

Hi everyone, I'm having a trouble with a calculation. I'm using a pretty complex metric and the components are very long because of that. I already did some modifications in the code for the expressions to be more readable (and fit on the screen), for example:

I import "cdb.core.component" as "component", and when I calculate the various components of the Riemann tensor "rm", I use

component.components_to_subrule(rm)
for i in range(len(component.components_to_subrule(rm))):
 display(component.components_to_subrule(rm)[i])

With proper indentation. This prints every component of an object in separate lines, as a subrule. This helps a lot, but it would be even better if I could print negative powers as fractions. I saw in the changelog that this was implemented, but couldn't find anywhere how to do it.

in General questions by (230 points)

1 Answer

+1 vote

You can switch to printing-as-fractions using

__cdbkernel__.display_fractions=True

This can be switched between any two cells, you don't have to use it for the entire notebook.

by (83.0k points)
...