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

I have to make multiple files in cadabra which has same assumption in all the files. Is there anyway in which i can stote these assumptions in a file and read that file in the multiple files i need.

For eg I have to make the following set of commands in 3 files

{u, r, z1 , z2, z3 , z4}::Coordinate;
{a , b , c , d , e , f , g , h , i , j , k , l , m , n#}::Indices(values={z1 , z2 , z3 , z4}, position=fixed);
\partial{#}::PartialDerivative;
q{#}::Depends( a , b , c , d , e , f , g , h , i , j , k , l , m , n#,\partial{#});
q_{a b}::Metric;
q^{a b}::InverseMetric;
q^{a}_{b}::KroneckerDelta;

Can you please help me how to call these set of assumption in multiple files so that if i change just the master file , the other files will be automatically updated.

in General questions by (650 points)

1 Answer

+1 vote

Put these lines in a separate notebook, let's say defs.cnb. Then import that notebook into another one by doing import defs.

by (82.5k points)
...