loadMacros(

"PGstandard.pl",

"MathObjects.pl",

"PGML.pl",

);

Context("Matrix")->flags->set(reduceConstants=>0,reduceConstantFunctions=>0);

$U = Formula("[

[sqrt(2),sqrt(2)],

[-sqrt(2),sqrt(2)]

]");

BEGIN_PGML

[`[$U]`]

END_PGML

ENDDOCUMENT();

This forum has a limit to the number of forum postings you can make in a given time period - this is currently set at 5 posting(s) in 1 day

This works for me in WW 2.14. But I had to use a Formula MathObject, not a Matrix. Depending on what else you are doing with $U, that may not be good.

EDIT: Now I see your more recent post. You are using things like the transpose method, which I will assume do not work on a Formula. But you could get around this by doing like:

$UforDisplay = Formula(...);

$U = Matrix("$UforDisplay");

and use them separately.

DOCUMENT();

loadMacros(

"PGstandard.pl",

"MathObjects.pl",

"PGML.pl",

);

Context("Matrix")->flags->set(reduceConstants=>0,reduceConstantFunctions=>0);

$U = Formula("[

[sqrt(2),sqrt(2)],

[-sqrt(2),sqrt(2)]

]");

BEGIN_PGML

[`[$U]`]

END_PGML

ENDDOCUMENT();

loadMacros(

"PGstandard.pl",

"MathObjects.pl",

"PGML.pl",

);

Context("Matrix")->flags->set(reduceConstants=>0,reduceConstantFunctions=>0);

$U = Formula("[

[sqrt(2),sqrt(2)],

[-sqrt(2),sqrt(2)]

]");

BEGIN_PGML

[`[$U]`]

END_PGML

ENDDOCUMENT();

You are currently using guest access (Log in)