# Questions tagged [linear-algebra]

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.

1,351 questions
Filter by
Sorted by
Tagged with
75 views

### Code for calculating the number of real roots of the polynomial [closed]

I'm trying to create a code that estimates the number of real roots of a polynomial. General algorithm is outlined in this document: http://stellar.mit.edu/S/course/6/sp10/6.256/courseMaterial/topics/...
60 views

### How to find the steps in finding the reduced row echelon form of a matrix programmatically?

I would like to figure out a way to see the row operations RowReduce uses to arrive at the reduced row echelon form of a matrix. I am aware of the step-by-step solutions in Wolfram Alpha and Wolfram ...
154 views

### Is there a way to view all two-dimensional arrays in matrix form?

Is there a way to ensure that every time I perform an operation such as RowReduce, Linear Solve, Null Space, Inverse, Eigenvectors, etc. that the matrix is displaying in MatrixForm instead of applying ...
24 views

Let $p(z)$ be a (not necessarily irreducible) polynomial in $\mathbb{Q}[z]$. Is there a built-in function I can use for determining the minimal polynomial of an element $\overline{q(z)} \in \mathbb{Q}[... 1answer 46 views ### "Instantiate" an output of Solve [closed] I would like to use Mathematica to find a non-trivial solution of the linear system$Ax = 0$. When I try running Solve[A.x == 0, x] the output I receive is a ... 1answer 41 views ### How to flip the z axis of a Graphics3D in order to create a left-handed coordinate space? I would like to know how this 3D graphic could interpreset the y axis as being the up direction and the z axis flipped so that it creates a left handed coordinate system? ... 0answers 55 views ### matrix problem: evaluation of column values which depend on a variable I do not use Mathematica for a long time and I have a question about a matrix problem. I add here the code: ... 1answer 108 views ### How to expand a function as a linear combination of other functions? I would like to be able to expand certain functions as linear combinations of other specified functions when I know that the original function can be represented in such a way e.g. we know that$\sin^{...
65 views

New to Mathematica. I want to create and combine K1, K2, and K3 (shown in the first picture below) into the 8x8 matrix shown in the second picture below and keep the heading as shown if possible: ...
287 views

### Library for FEAST method is missing

Mathematica (V 12.3.1, Native Mac M1 version) is not letting me use the FEAST method for solving eigenvalue problems. For example, ...
44 views

### Block Matrix Algebra of Implicit Matricies

I get some unexpected behaviour from building block matrices of implicit matrices in Mathematica. Using this initial setup ...
121 views

### Listing all Index Possibilities Given a Vector and Indexed Set

Let's say I am given a vector $v=(5,2,-2,-4,3)^T$ and $\alpha \in \{-1,1\}$. I want to find all indices $(\alpha,i)$ such that $\alpha v_i >0$, where $v_i$ is the $i$th entry of the vector $v$ ...
105 views

### Find relationship between parameters to prove conditions of eigenvalues

I have the following 3-by-3 matrix. I need to find condition(s) on the parameters 'a' and 'b' such that this matrix has exactly 1 eigenvalue bigger than 1 in absolute value and other two eigenvalues ...
52 views

### Supplying a seed for an iterative method in LinearSolve

Just a quick question. Does anyone know if it is possible to supply a seed for the iterative methods in LinearSolve? I have a large sparse system, and even using some Krylov iterative solver, my ...
35 views

### How to plot linear fits with a specific range from imported data?

So I imported multiple data points starting off from data1 to data11. I have them configured onto a graph, but I also have to find the line of best fit for each. I need to find the line of best fit ...
48 views

### Matrix multiplication with non-commuting objects (Quantum)

Given a matrix A = {{0,a,a,0},{b,0,0,a},{b,0,0,a},{0,b,b,0}}, where $a$ and $b$ do not commute, how do I calculate $A^2$ in Mathematica? (Later on, I would like to ...
64 views

### Cholesky-like (rank-revealing?) decomposition on singular matrices

For a singular Gram matrix $B$ I need to find some matrix $A$ such that $AA'=B$. I can add a small multiple of identity matrix, but this could break upstream analysis (application is c-approximation ...
38 views

### Generate a normalized Haar-random vector

What is the procedure to generate a random qutrit quantum state? That is, I want to generate a $3 \times 1$ vector $u$ such that $u$ is generated by a Haar random $3 \times 3$ unitary $U$ multiplied ...
39 views

### Finding kernel of linear transformation

Suppose I have a vector space V generated by {x1x2x3,x32,x21x4} over Q and another vector space W generated by {x21x3,x1x22} over Q and L is linear transformation which maps x1x2x3↦x21x3, x32↦3x1x22 ...
71 views

82 views

### A function that modifies functions - well-defined operation?

Here's my basic setup: Say I have a list of specific symbols and a function noSymbol, which accepts a mathematica expression and checks whether any symbol from my ...
124 views

### Eigenvalue and SparseArray

This the code of Hofstadter spectrum for square lattice using Mathematica ...
98 views

### Given A and B, how to find C if A = CBC?

Given A={{0,1,1,0},{1,0,0,-1},{-1,0,0,1},{0,1,1,0}} and B={{0,1,0,0},{0,0,0,0},{0,0,0,1},{0,0,0,0}} and ...
31 views

### Question about a restricted rewrite rule [closed]

I just started learning Mathematica and I'm not sure why a function I defined doesn't work. So I'm trying to write a function that takes a list of vectors and eliminates all zero vectors (with respect ...
227 views

### What is the best source to learn how to use tensor operations (exterior algebra) in Mathematica?

I'm specifically interested in the TensorProduct,TensorWedge, HodgeDual and certain build in functions to do tensor arithmetic like TensorReduce, TensorExpand. I would like to do exterior algebra ...