Questions about Mathematica functionality related to manipulating vector spaces and linear mappings between such spaces. This includes determination of matrix properties, matrix transformations, decompositions, and factoring.

learn more… | top users | synonyms

0
votes
0answers
47 views

Problem with Volume and Parallelepiped

This worked (copied from the documentation), and gave correct image with Graphics3D. R = Parallelepiped[{0, 0, 0}, {{1, 0, 0}, {1, 1, 0}, {0, 1, 1}}]; Volume[R] ...
2
votes
0answers
61 views

Aguilera-Perez Algorithm of $nD$ rotation matrix

I want to compute a general $nD$ rotation matrix which corresponds to a rotation by an angle $\theta$ around an $(n−2)$-dimensional subspace. I found the Aguilera-Perez algorithm in their paper: ...
4
votes
3answers
91 views

Expanding a matrix in a set of matrices

Consider a vector $a=\{a1,a2,a3\}$. I computed $e^{i a\cdot \sigma}\qquad \sigma: {\rm Pauli\ matrices}$ and then applied the command ExpToTrig. Now I want to expand the above result in terms of ...
0
votes
0answers
67 views

Gauss-Jordan program in Mathematica

Hi to everyone I made this program to solve a linear system by Gauss Jordan, this is my code to solve the system: ...
2
votes
2answers
117 views

Symbolic linear algebra gradients/matrix calculus

Can Mathematica generate symbolic expressions for gradients? For example, if $x_1$ and $x_2$ are two points, could I get Mathematica to generate expressions similar to the following? $\frac{\partial ...
0
votes
0answers
65 views

Why does a badly conditioned matrix give a totally different results in LinearSolve function? [closed]

Here I define a vector: C1p[n_, h_] := C1p[n, h] = LinearSolve[D1p[n, h], F1p[n, h]]; with 4*4 Matrix D1p[n,h] badly ...
3
votes
1answer
97 views

Efficiently compute this Table of NullSpace

I have two $(2n,2n)$ matrices, $A_1$ and $A_2$, and I would like to compute $$\ker(A_1^p A_2^q -I)$$ for $p,q\leq 2n$. Both matrices are orthogonal and have exactly four non-zeros values on each ...
0
votes
0answers
37 views

Compiling LinearSolve with 2 complex matrices, possible bug

Take two complex matrices depending on one variable, for example: ...
2
votes
1answer
65 views

Linear regression

I have a sequence of data: data = {0.647888, 0.522495, 0.454224, 0.417054, 0.396816, 0.385798, 0.379799, 0.376532, 0.374754, 0.373786, 0.373259, 0.372972} How ...
0
votes
1answer
66 views
-1
votes
1answer
51 views

Orthonormalization of a set of vectors

I know of the commands Orthogonalize[] and Normalize, but how can I combine them into one command that its output will be an orthonormalized list of the input vecotrs? Thanks in advance. P.S How to ...
2
votes
0answers
27 views

Using Arnoldi Method with Multiple Options

I have a matrix with many complex eigenvalues, but I only need a few near a particular complex number. I am only looking at the imaginary parts, so I need the few closest on the imaginary scale to my ...
3
votes
1answer
46 views

Use of Inverse Matrix

I solved a matrix as follows: {{0,1,1},{0,2,4},{0,3,9}}.{{0},{25},{20}} Resulting: {{45},{130},{255}} I tried to use an ...
0
votes
1answer
50 views

How can we do LDU decomposition modulo $p$?

If we have an $n \times n$ matrix, with all entries taken modulo $p$, how can we output the three matrixes in LDU decomposition, with all entries again modulo $p$? We can assume the input matrix is ...
-1
votes
1answer
65 views

How to correctly calculate symbolic eigenvectors

I give a minimalistic example of my problem: I have a matrix: m[a_,b_]:={{0,-a+b},{b,0}}; I define the eigenvectors as: ...
2
votes
1answer
79 views

Solving for five unknowns in a 3 x 3 matrix

I know that matrix.Transpose[matrix] = IdentityMatrix[3] matrix = {{0.8111, 0.4867, -0.3244}, {a,b,0}, {c,d,e}} I tried ...
3
votes
2answers
130 views

GridLines for a coordinate system with a particular basis

Suppose that I use the vectors (2,1) and (-1,1) as a basis for $R^2$. ...
2
votes
1answer
51 views

Finding an Integer, Unimodular Matrix that connects two given matrices

I have two symmetric, integer matrices, $K$ and $K_2$ which have the same determinant and the same signature (number of positive - number of negative eigenvalues). I want to find an integer valued ...
1
vote
2answers
117 views

How to plot a lattice (2D or 3D) given a basis

I want a graphical picture of a lattice with basis such as $\{(1,1), (\sqrt{2}, -\sqrt{2})\}$. Does Mathematica already have a pre-made function that finds all linear combinations over $\mathbb{Z}$ ...
0
votes
0answers
19 views

General question about solving a large set of linear equations efficiently

In my research, I got a large set of linear equations, about 10 000 equations with more than 10 000 variables. It is not efficient to use "Solve", so does anyone know any way to solve the equations in ...
6
votes
2answers
269 views

Find a condition that b must satisfy so that Ax=b has solution

I'm new to Mathematica, so I'm sorry if this is really simple. I am trying to find the condition that vector b must satisfy so that Ax=b has solution. I would like to learn a general method, but I'll ...
17
votes
4answers
353 views

Speedup matrix number multiplication

Consider this simple matrix number multiplication: ...
1
vote
1answer
55 views

Fast Eigensystem calculation

I have a code which finds the eigensystem for a matrix H = H0 + x HInt, where x is a variable which turns on the interaction. H0 is diagonal, and HInt is a sparse matrix (with about 400 states, I hope ...
2
votes
0answers
89 views

How does Mathematica compute the determinant of a matrix? [closed]

I have been trying to write efficient code for calculating the matrix determinant for some time now. I noticed last night that Mathematica is able to compute the determinant of a $200 \times 200$ ...
3
votes
1answer
121 views

Optimize a parametric matrix to get a lowest possible eigenvalue

This question is a followup of Plot the lowest eigenvalues of a parametric matrix Now I can get the lowest eigenvalue LowEign(t) of the matrix for a given t numerically. When I plot the LowEign ...
1
vote
1answer
154 views

How do you solve a linear equation of matrices? [duplicate]

The function Solve works fine for scalars: In[]:= Solve[A x - x B + C == 0, x] Out[]= {{x -> -(C/(A - B))}} When using matrices however, ...
1
vote
1answer
67 views

A question on JordanDecomposition in Mathematica

How can I have Mathematica show me also the inverse matrix of the similarity matrix of JordanDecomposition of a matrix? Obviously I need to use here the ...
2
votes
0answers
56 views

Why can Mathematica compute numerical sums more efficiently when they are written as matrix operations?

Let $f(n)$ and $K(n,m)$ be functions such that the double sum, which we wish to evaluate numerically, $$ \sum_{n=1}^a \sum_{m=1}^a f(n) f(m) K(n,m) $$ exists when $a$ is some large positive number. I ...
0
votes
0answers
57 views

Learning Mathematica for Math Majors [duplicate]

I just downloaded Mathematica and I'm taking a course in Multivariable Calculus. I realize there is a lot of complexity to Mathematica and there are Many types of learning resources out there. I was ...
2
votes
1answer
66 views

Accuracy limitations of singular value decomposition?

in the process of working on a physics problem I have found the need to use the singular value decomposition function built into Mathematica. I have encountered what seem to be limitations to the ...
0
votes
0answers
26 views

Ordering of Eigensystem in symbolic computations [duplicate]

Suppose I have a symbolic 4x4 matrix for which I am finding the Eigenvectors and Eigenvalues. My question is whether Mathematica ...
1
vote
1answer
67 views

Plotting Invariant Manifolds of the Henon Map

Given the following map: \begin{align} & x_{n+1}=-y_n+2x_n^2 \\ & y_{n+1}=\beta x_n \end{align} for $β \in (0,1)$, $x_n \in \mathbb{R}, y_n \in \mathbb{R}$ (which is a one parameter version ...
1
vote
0answers
47 views

Working with matrix

Considering the 3x3 matrix: m = {{0, -(I/Sqrt[2]), 0}, {I/Sqrt[2], 0, -(I/Sqrt[2])}, {0, I/Sqrt[2], 0}} How would I find its normalized vectors eigenvectors u_i ...
3
votes
0answers
69 views

Why does Eigenvalues work for a matrix $\{M\}$ but not $\{\{M\}\}$?

Suppose I have a matrix {{1, 2}, {3, 4}} which I'll call mat. In a blur of human error, I computed the eigenvalues of ...
5
votes
0answers
79 views

Is it possible to speedup these simple linear algebra operations

I'm trying to numerically solve some equations using splitting operator method. The solver I construct iteratively constructs a matrix and feeds it to LinearSolve. ...
0
votes
0answers
42 views

Hash in Eigenvalue calculation [duplicate]

When I tried to find the eigenvalue of a 5x5 matrix, I get the following ...
1
vote
0answers
39 views

Getting the row/column reduction matrix of a matrix m

Is there a simple way to get the row reduction matrix for a matrix m? As in, a matrix a such that ...
10
votes
0answers
118 views

Possible Bug in LinearSolveFunction with Sparse Vectors

Bug introduced in 5.0 and persists through 10.4.1 LinearSolveFunction is new in 5.0 Consider the following set of equations and corresponding variables: ...
2
votes
0answers
68 views

Unexpected behavior from applying ToRadicals to eigenvalues [closed]

I am trying to get the symbolic form of a $10 \times 10$ matrix (I know, that is generally too large). ...
1
vote
1answer
89 views

Sum to Zero Constraint in GeneralizedLinearModelFit

Is there a way to impose a constraint on a generalized linear model fit in Mathematica? In R, when using the glm() function, you can set options(contrasts=c('YY.sum', 'ZZ.sum')). Is there something ...
0
votes
1answer
101 views

Find partial solution for underdetermined system of Boolean equations (Minesweeper)

In this article about creating a Minesweeper solver, the author talks about using matrices to solve given portions of a Minesweeper board. While reading that, I thought of a different way to limit the ...
3
votes
1answer
83 views

Plotting eigenvalues smoothly

I am trying to plot how the eigenvalues of a matrix change by changing a given a parameter t. Of course the ordering of the eigenvalues does not matter mathematically but it does when I want to make ...
0
votes
0answers
55 views

Strange sharp spikes causing overflow while doing gradient descent

I am trying to find a function h(r) that minimises a functional H(h) by gradient descent. The result of H(h) is a single number. (Basically, I have a field configuration in space and I am trying to ...
1
vote
1answer
72 views

Creating a transformation matrix with respect to given bases? [closed]

Let's say I have a linear transformation $T:V\to W$, along with some bases $\{v_1,v_2\}$ and $\{w_1,w_2,w_3\}$ of each respectively. Let's say all the information I have about the transformation and ...
2
votes
1answer
59 views

Efficiently Invert a Square, Block Diagonal Matrix

I am generating an n x n matrix where n is specified by DIM: ...
2
votes
2answers
70 views

Symbolic calculation of the rank of jacobian matrix

I would like to symbolically determine the rank of a jacobian matrix. In the help, I have seen that the MatrixRank function can be used for this purpose. However, when I use this function, the ...
-1
votes
2answers
100 views

linear system equation ( trying to solve ) [closed]

I am trying to solve this system 3.7 x1+51.5 x10+71.3 x11-84. x2-16. x3-57.7 x4+89.7 x5-54.9 x6-85.8 x7+57.8 x8-51.3 x9==-36.8 -86.3 x1+5.7 x10-0.2 x11-39.9 x2+52.6 x3-45.6 x4+78. x5+90.7 x6-86.2 x7-...
0
votes
1answer
49 views

Extract solutions of linear system to variables

I need to output the answers from solve into the variables named just as they were named in the solve equations. I have checked out this thread Assign the results from a Solve to variable(s) but ...
1
vote
2answers
63 views

Trouble implementing logarithmic matrix norm

I wanted to write a quick function that calculates the logarithmic matrix norm with respect to the spectral norm. The formula is $$ \mu_2(A) = \lambda_\mathrm{max}\left(\frac{A + A^T}2\right). $$ So ...
1
vote
1answer
55 views

Only get the lowest Eingenvalue? [duplicate]

I have a huge sparse matrix and I want to have the smallest eigenvalue and its corresponding eingenvector. I use this code (a used a smaller matrix for the example): ...