I am trying to perform some symbolic calculus with tensors and matrices. I have recently noticed that one can set assumptions on variables by using the command $Assumptions$
as described here. However, when I make
$Assumptions$ = U ∈ Matrices[{d, m}, Reals];
$Assumptions$ = P ∈ Matrices[{d, t}, Reals];
Y = Transpose[U].P;
Dimensions[Y]
I get
(* {2} *)
Using TensorDimensions
doesn't return a useful result either, as
TensorDimensions[Y]
(* TensorDimensions[Transpose[U].Phi] *)
If I am assuming $U$ to be a $d\times m$ matrix and $P$ to be a $d\times t$ matrix, then the product between $U^{\intercal}P$ should be an $m\times t$ matrix. I am sure I am probably misunderstanding either the usage of $Assumptions$
or the usage of the command Dimensions[]
regarding this particular case. But if that is so, why is it not working this way?
$Assumptions
, not$Assumptions$
. Second, when you run$Assumptions
twice, you override the first cases withU
. You can make either aList
of assumptions or connect them with&&
. Then you'll get{m,t}
asTensorDimensions[Y]
. $\endgroup$$Assumptions
, per documentation, is only meaningful when used in functions that take theAssumptions
option.Dimensions
is not such a function butTensorDimensions
is. $\endgroup$