| bio | website | |
|---|---|---|
| location | Waterloo, ON | |
| age | ||
| visits | member for | 1 year, 2 months |
| seen | May 1 at 21:55 | |
| stats | profile views | 5 |
|
Apr 24 |
comment |
Assignment rule to distribute matrix-multiplication over custom notation (Sorry, didn't relise pressing return posted the comment) Thanks for the answer! It seems that while using the last environment the expression doesn't evaluate correctly unless I use the following definitions: ClearAll[myDot];
myDot[M_, Ket[s__]] := VecToKet[M.KetToVec[Ket[s]]];
myDot[M_, myTimes[a_, Ket[s__]]] :=
myTimes[a, VecToKet[Dot[M, KetToVec[Ket[s]]]]];
myDot[M_?MatrixQ, myPlus[args__]] :=
myPlus @@ Map[myDot[M, #] &, {args}];. Replacing the 'Dot' with 'myDot' in the 1st and 2nd definitions above results in errors in the VecToKet function I have. |
|
Apr 24 |
comment |
Assignment rule to distribute matrix-multiplication over custom notation For some reason while using the last environment the expression didn't evaluate correctly. To get it to work I had to use the following definitions: |
|
Apr 24 |
comment |
Assignment rule to distribute matrix-multiplication over custom notation Thanks for the link. |
|
Apr 24 |
revised |
Assignment rule to distribute matrix-multiplication over custom notation Re-edit: Actually should have been s__ not s_. |
|
Apr 24 |
awarded | Scholar |
|
Apr 24 |
awarded | Editor |
|
Apr 24 |
accepted | Assignment rule to distribute matrix-multiplication over custom notation |
|
Apr 24 |
revised |
Assignment rule to distribute matrix-multiplication over custom notation Fixed typo where "s" should have been "s_" in lhs of assignment rules. |
|
Apr 23 |
awarded | Student |
|
Apr 23 |
asked | Assignment rule to distribute matrix-multiplication over custom notation |