Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [products]

Questions about the use of `Product`, `NProduct`, and other types of multiplication, like `Dot`.

1
vote
2answers
81 views

Where is the “mistake in the recursion” while there is no recursion? [closed]

So my code is as follows xi = Exp[2*Pi I/13] tauA = xi + xi^(-1) sigma[tau_, n_] := tau^n Product[(x - sigma[tauA, i]), {i, 3, 8}] // FullSimplify This should ...
0
votes
1answer
35 views

How to create a dot product version of the product function

I would like to create a function to matrix multiply (dot product) n matrices together, where n is large, for example M1*M2*M3*M4*M5*...*Mn I know there is the 'product' function that can do this ...
1
vote
1answer
36 views

How to PowerExpand a generic Product?

I have: PowerExpand[Log[Product[f[i], {i, 1, n}]]] // InputForm (* Output: Log[Product[f[i], {i, 1, n}]] *) However, I would expect to get the following as the ...
2
votes
4answers
177 views

Dot product result has wrong dimension [closed]

I'm doing a small project and I've encountered a problem while using Mathematica. I should mention that I'm kinda new to this software, so maybe it's just something I haven't grasped yet. Anyway, I ...
1
vote
1answer
86 views

why does this simple ratio of products not simplify?

Why does this ratio of products not Simplify to a[n]? Clear[a,k,n] $Assumptions={n>1} Simplify[ Product[a[k], {k, 1, n}] / Product[a[k], {k, 1, n - 1}] ] ...
2
votes
2answers
135 views

Sums of products with $ n $ variables

I want to be able to compute a function of $ n $ indices which looks as follows if $ n>2 $: $$ \sum_{(i=1,j=1,k=1,l=1,...), (i\neq j\neq k \neq l \neq ...)}^{n} x_{i}x_{j}(x_{k}^2+y_{k}^2)(x_{l}^...
0
votes
0answers
19 views

Product works, but not when I add a condition : Product[ If[…] ]

I am trying to create a product loop where each term is taken from a list, i.e. (x[[2]]-x[[1]])*(x[[2]]-x[[3]])*(x[[2]]-x[[4]])... The following code gives what ...
1
vote
2answers
163 views

Calculating the series expansion of a theta function

I have defined the q-theta function as follows: $$\theta(x;q) = \prod_{k=0}^{\infty} (1-q^k x)(1-q^{k+1}/x)$$ I want to calculating, using this, the series expansion of the following series: $$\...
1
vote
1answer
86 views

Calculate the product

I have the following problem: Wolfram calculates the product incorrectly. In addition, lots of errors appears. Is it possible to improve the code? Thanks in advance! Define functions: ...
4
votes
2answers
90 views

Expanding Log[Product[…]]

I'm trying to get the log-likelihood of a Gaussian in the form $$ p(\textbf{x}|u,\sigma^2)=\prod_{n=1}^{N}\mathcal{N}(x_n|\mu,\sigma^2) \quad (1) $$ $$ \ln\ p(\textbf{x}|\mu,\sigma^2)=-\frac{1}{2\...
3
votes
2answers
224 views

How to get vector a from known inner product?

Assuming that a.b=z,where b={b1,b2,b3} and z=x b1+y b2+z b3, obviously ...
0
votes
1answer
38 views

hermitian matrix-vector product does not give real result

Background : If $H$ is a Hermitian matrix, then for any complex vector $\psi$ it holds that $\psi^* \cdot H\cdot \psi$ gives a real number. The problem I am creating a 16x16 Hermitian matrix in ...
11
votes
3answers
1k views

François Viète's approximation to π

How do I program the approximation to π devised by François Viète, which is given by 2 * 2/Sqrt[2] * 2/Sqrt[2 + Sqrt[2]] * 2/Sqrt[2 + Sqrt[2 + Sqrt[2]]] * ... ...
0
votes
1answer
57 views

Product of matrices with symbolic bounds

Before this is closed for duplicate, know that I have read the following posts: A product function for matrix products Taking the product of a list of matrices [duplicate] I need to multiply a ...
0
votes
2answers
75 views

Defining a recursive product function

I have defined a non-commutative product: ...
6
votes
1answer
98 views

Infinite product with the Catalan numbers

During the analysis of OEIS sequence A179381 I got the following expression with an infinite product: $$\prod _{k=1}^{\infty } \left(1-4^{-k} C_{k-1}\right)$$ ...
0
votes
1answer
84 views

Sum over permuted and unpermuted indices

I would like to write a code to evaluate the following (up to $N=20$) $\sum_{s_1,...,s_N=\pm 1;s_1 \cdot \cdot \cdot s_N=1}\sum_{\sigma\in S_N}\prod_{i=1}^N x_{\sigma(i)}^{s_i \lambda_i}$ There are ...
1
vote
1answer
22 views

User-defined Product with blocked variable and syntax hightlighting

I want to define a new Product but for NonCommutativeMultiply, which I do something like this: ...
1
vote
1answer
66 views

Summation and production using hold

Let's take a sum and an example production $z_{1}=\sum_{k=1}^{3}(k!+(k+1)!)$ and $z_{2}=\prod_{k=1}^{3}(k!+(k+1)!)$ I wish to get in z1 a result like that $...
1
vote
1answer
91 views

Can I split products into list [closed]

Is there a way to take a term that is a product like xyz and split it into {x,y,z}?
1
vote
1answer
239 views

How can I multiply all elements of a list together with user-defined multiplicatoin? [closed]

so currently I have my own definition of multiplication between elements but it can only multiply two elements. MyMult[a_,b_]:=... I want to multiply all ...
2
votes
2answers
79 views

Product over several previous primes

I'd like to evaluate $$\prod_p\left(1-\frac1p\right)$$ over the $k$ largest previous primes $p\le n/2$, where $n$ is the parameter. E.g., if $n=20$ and $k=3$, I'd like the product to be over the 3 ...
0
votes
3answers
124 views

Listing products of prime powers

Given a positive integer $n$, what is the code to list $2^{a_2}3^{a_3}\cdots p^{a_p}$, where $a_i\ge 0$ are integers, with respect to the lexicographic ordering on $(a_2,a_3,\ldots, a_p)$? The only ...
5
votes
2answers
144 views

Series expansion of a certain infinite product

I wanted to find Series[Product[Cos[t/n], {n, 1, Infinity}], {t, 0, 5}] but failed. Then, I tried ...
7
votes
1answer
124 views

Cross product without reordering (noncommutative)

Not related to question I assume this question (as it is of very general structure) might have been asked before, unfortunately I did not find an answer to it - despite what I used as search queries. ...
3
votes
1answer
400 views

Multiply lists of matrices

Hello I would like to multiply a list of matrices by another list of matrices and return all elements. I.e. K={A,B,C} L={X,Y} And the result should be ...
11
votes
1answer
419 views

multiplication of vector spaces

Original Question Disclaimer: The question motivated by the product of Hilbert spaces which arises from separate degrees of freedom which a system might contain in quantum technical system. Examples ...
4
votes
1answer
89 views

N[Product] and NProduct give different results

I have some trouble. I've been using finite product to study a certain function (see below). However, when I wanted to compute it precisely, I decided to use ...
2
votes
1answer
93 views

Net Present Value Calculation for a Changing Variable

I have a list of 1000 lists, each comprising 100 pairs of numbers, with the first of these numbers running from 1 to 100, and the second being an output from an equation, dependent upon variable G. ...
1
vote
0answers
192 views

Creating a scalar product function [closed]

I'm new to Mathematica and I'm struggling a bit with it. I need to make a function that returns me the scalar product $a\cdot b$ of two vectors $a$ and $b$, without using the ...
0
votes
0answers
82 views

Expressing the output product using dot

I have an expression of the form Hbar.H where H and Hbar are vectors. How can I get the ...
10
votes
1answer
170 views

TensorReduce and Dot

I'm manipulating abstract tensors with Mathematica. I have a question. With the assumptions $Assumptions = (R | r) ∈ Arrays[{4}]; I can do two operations: ...
2
votes
1answer
141 views

How to put conditions on indices of product

I'm trying to solve for the Lagrangian form of the interpolation polynomial. Right now, I'm just trying to solve for the $l_i(x)$ values which are equal to $l_i(x)=\prod_{j\neq i, j=1}^{n}{\frac{x-x_j}...
5
votes
0answers
71 views

TensorContract applied twice

I have a very simple question about TensorContract command: I'm declaring ...
2
votes
1answer
166 views
2
votes
1answer
217 views

Multiply all matrices in an array

Disclaimer: I'm new to Mathematica. I have an array $\gamma[i]$ of length $n$, each element of which holds an $m\times m$-matrix. I would like to multiply all of them, $$\prod_{i=1}^n \gamma[i].$$ I ...
0
votes
0answers
268 views

Non commutative products and scalars

Say I have an expression such as $$a.(\alpha b)$$ where $a$ and $b$ are non-commutative operators, but $\alpha$ is simply a scalar. How do I tell Mathematica to treat $\alpha$ as a scalar and "pull" ...
3
votes
2answers
2k views

How to compute the partial trace of a 4x4 matrix?

I want to compute a partial trace using formula $\rho_A=\sum\langle B|\rho_{AB}|B\rangle$ . Example, $\rho_{AB}= $$ \begin{pmatrix} a & b & c & d\\ e & f & g & h\\ i &...
0
votes
1answer
143 views

How to multiply two tensor with arbitrary ranks, on one index only (like GR)?

I am writing a function which take two tensors with the same dimensions but with arbitrary ranks and multiplies them over one index, just like this example from GR: See, I couldn't use ...
1
vote
0answers
169 views

`QPochhammer` function simplification?

Consider the function $$(a;q)_n=\begin{cases} 1&n=0,\\ (1-a)(1-aq)\cdots(1-aq^{n-1})&n=1,2,\dots,\\ [(1-aq^{-1})(1-aq^{-2})\cdots(1-aq^n)]^{-1}&n=-1,-2,\dots \end{cases}$$ which in ...
0
votes
2answers
199 views

Conditions on a product

I want to impose specific conditions on a product I am trying to take. I found this previous question asked here but when I use this I get zero. My expression is $$ \prod_{(i,j)=(-a+1,-b+1)}^{(a,b)}\...
0
votes
1answer
227 views

Iterating KroneckerProduct[] and returning the result from a function

I am trying to write a function which will take a matrix m and an integer i as inputs. Then it will compute the Kronecker product of m with itself i times and return the result. The code is as follows....
2
votes
0answers
384 views

Outer product using the quantum mathematica package

I am using the quantum Mathematica package and am trying to do computations that require me to use the outer (tensor) products of Pauli matrices. I would define this as, for example, ...
3
votes
1answer
982 views

How to create simple (tensor) product spaces?

Is it possible to work with simple tensor product spaces, like multiplying product states from quantum mechanics? I basically have a simple two dimensional vector space, whose elements are ...
1
vote
0answers
48 views

How to pack arguments of a function into a vector for brevity? [closed]

I have a function like the following one: F[a_, b_, c_, d_] := Product[f[x, y, z, j, i], {j, a, b}, {i, c, d}] where ...
1
vote
1answer
478 views

Using Collect to group derivatives together

Is there a way to combine derivatives that are a result from the product rule back together using Collect. For example, I'd like to collect x Dt[y,b] + y Dt[x,b] ...
1
vote
2answers
215 views

How to expand an infinite product?

How can I use Mathematica to expand such a product (only need a finite number of terms): $$\prod^{\infty}_{n=1}\frac{({1-yq^{n+1}})({1-y^{-1}q^n})}{(1-q^n)^2}$$
3
votes
1answer
89 views

Large products of a matrix-valued function [closed]

I have a $3\times 3$ matrix valued function $f(x)$ where $x\in\mathbb{R}$. I want to perform the following: $$\prod_{k=a}^b f(k),$$ where $a,b$ are known, but I cant seem to get Mathematica to do ...
15
votes
5answers
556 views

Infinite product for Zeta[2]?

I have crafted an infinite product that converges to Zeta[2] very slowly! ...
4
votes
2answers
403 views

Determine the coefficient of expansion of the product of two sumations?

I would like to determine the coefficient of a desired term in the product of two summation where the powers of $x$ are not necessarily integers. For example $$ \sum_{i=1}^N x^{1/i}\sum_{j=1}^N x^{1/j}...