Hot answers tagged

7 votes
Accepted

Efficient computation of a matrix times its transpose

Edit and Warning: I noticed that my timing may not have been quite correct, or at least has to be interpreted carefully, please see the edit. As @Roman points out, one should check if one really has ...
user avatar
  • 4,448
6 votes
Accepted

VectorAround problem

Its hard to say if this answers it for you since it seems to be version dependent and my current 12.3 runs error free. But i had these error often before. It got better in 13.1. for me. Essentially ...
user avatar
  • 4,916
6 votes
Accepted

Proof of symbolic matrix

TensorExpand[ f[G, H] == Subscript[k, 1]*f[A, H] + Subscript[k, 2]*f[B, H]] (* True *)
user avatar
  • 35.7k
4 votes
Accepted

Calculating power series of quantum operators on kets

The reason is simple: this package uses CenterDot as multiplication, while Series of Exp ...
user avatar
  • 172
4 votes
Accepted

Calculating the matrix product of the elements of a table

The For-loop given by OP can be replaced by Map as follows: ...
user avatar
  • 4,448
4 votes
Accepted

Minimize Sum of Hamming Distances

Keep agreement[] from evaluating on symbolic y with the _?... pattern tests. Also total up ...
user avatar
  • 219k
2 votes
Accepted

Constructing NxN tridiagonal block diagonal matrix with N is a variable

...
user avatar
  • 123k
2 votes

Converting a list of values to a criterion

If instead of a selector list that was integers you had a selector list that was named patterns, it would work very easily. So, given, ...
user avatar
  • 6,544
2 votes

How to solve this equation with rank relation of matrix

I have made a MatrixRankSym feature with symbolic computation here. And we can use it directly: For your first equation: ...
user avatar
  • 24.5k
2 votes

How to solve this matrix equation

I have made a MatrixRankSym feature with symbolic computation here. And we can use for this question directly: ...
user avatar
  • 24.5k
2 votes

Manipulating a Haar random unitary matrix and computing probabilities

Code to calculate the probabilities when $U$ is a $2^n \times 2^n$ unitary matrix: ...
user avatar
  • 4,448
2 votes
Accepted

Proper usage of Assuming statement

As described in the comments and the documentation, Assuming evaluates an expression with new assumptions appended to ...
user avatar
  • 31k
1 vote

How to make a matrix a set of variables to be manipulated?

Maybe this is what you are looking for: f = Array[a, {2, 2}]; Manipulate[Evaluate[f], {a[2, 1], 0, 1}] Now you have one slider that adjusts the value of a[2,1] ...
user avatar
  • 65.8k

Only top scored, non community-wiki answers of a minimum length are eligible