19 votes
Accepted

How to calculate $\prod\limits_{p}\frac{p^2+1}{p^2-1}$?

A Trace reveals the problem: ...
user avatar
  • 216k
16 votes

François Viète's approximation to π

You could use VietePiApprox[n_] := (Times @@ NestList[Sqrt[2 + #] &, Sqrt[2], n])/ 2^(n + 1) SetAttributes[VietePiApprox, Listable] which approximates Pi as ...
user avatar
  • 14.9k
12 votes

Infinite product for Zeta[2]?

Amplifying on answer by @rhermans ...
user avatar
  • 120k
11 votes
Accepted

Infinite product for Zeta[2]?

Product[ (1296 n^4 (1 + (1 + n)^3))/((-1 + 36 n^2)^2 (-1 + (1 + n)^3)) , {n, 1, ∞} ] === Zeta[2] True ...
user avatar
  • 29.3k
10 votes
Accepted

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

Your example can be achieved using Map with a level specification, Partition to generate the sub-matrices and ...
user avatar
9 votes

François Viète's approximation to π

Well, FoldList also can finish this job: 2/Times @@ (1/2 FoldList[Sqrt[2 + #] &, ConstantArray[Sqrt[2.], 10]]) By the way,...
user avatar
9 votes
Accepted

Closed form of product of Gamma function

Workaround: $$\Gamma \left(\frac{k}{n}\right)=\frac{\Gamma \left(\frac{k}{n}+1\right)}{\frac{k}{n}}$$ ...
user avatar
8 votes

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

You can achieve this by partitioning your matrix and performing a tensor contraction. To be clear, having: $$ \rho_{AB} = \sum_{ijkl} \rho_{ij}^{kl} | ij \rangle \langle kl |$$ the partial trace over $...
user avatar
8 votes

Infinite product for Zeta[2]?

I tried to find an even simpler product. Here's my solution: $$ \zeta(2) =\prod _{n=1}^{\infty } \frac{1}{\left(1-\frac{1}{4 n^2}\right) \left(1-\frac{1}{36 n^2}\right)}$$ In Mathematica ...
user avatar
8 votes
Accepted

How to create simple (tensor) product spaces?

Here is the basic method, illustrated with the combination of two spin-1/2 particles. (Hopefully, the physics language is familiar or accessible; I don't really have an idea of where else this kind of ...
user avatar
  • 21.6k
8 votes
Accepted

multiplication of vector spaces

Here's a take that allows one to keep track of the order of things carefully. Note that this is similar in nature to the answer here. Annihilation operators We first construct the annihilation ...
user avatar
  • 21.6k
8 votes
Accepted

How to simplify Sum's and Product's of arbitrary length?

...
user avatar
  • 120k
8 votes
Accepted

How can I tell `Dot` to behave automatically linear?

Use TensorExpand[] instead: ...
7 votes

Evaluating the product of a matrix sequence

Dot @@ (a /@ Range@10) (* {{1, 55}, {0, 1}} *) Also Dot @@ Array[a, 10]
user avatar
7 votes

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

prod[n_Integer?Positive] := Sum[x^(1/i), {i, n}]* Sum[x^(1/i), {i, n}]; Coefficient[prod[50], x^(3/10)] 4 Or ...
user avatar
  • 120k
7 votes
Accepted

Cross product without reordering (noncommutative)

It's handy to use a wrapper for things like vectors with nonstandard properties. So, choose a name like ncVec for your non-commutative vectors. Define its behavior ...
user avatar
  • 13.5k
7 votes
Accepted

Series expansion of a certain infinite product

One idea is to convert the product to a sum by using Log, then convert to a series, and then convert back using Exp, although ...
user avatar
  • 124k
7 votes

How to simplify Sum's and Product's of arbitrary length?

rule1 = Sum[a_Times, b : {i_, __}] :> Select[FreeQ[i]][a] Sum[Select[Not@*FreeQ[i]][a], b] rule2 = Product[Power[a_, b_.], c_] :> Product[a, c]^b; Examples: ...
user avatar
  • 349k
6 votes

Infinite product for Zeta[2]?

This is going to be an alternative answer to Dr. Wolfgang Hintze's question. Consider a limit: \begin{equation} g := \prod\limits_{n=1}^\infty \frac{1}{\left(1-\frac{A^2}{n^2}\right)\left(1-\frac{B^2}...
user avatar
  • 161
6 votes
Accepted

High precision calculation of infinite product involving prime numbers

Using the formula given in the arXiv preprint Patrick linked to for the "carefree constant" gives: ...
user avatar
6 votes
Accepted

N[Product] and NProduct give different results

A bit of re-writing can get around this: ...
user avatar
  • 10.6k
6 votes

François Viète's approximation to π

Clear[VietePiApprox]; VietePiApprox[n_] := Product[FunctionExpand[Cos[Pi/2^(i + 1)]], {i, 1, n}]; Table[VietePiApprox[i], {i, 1, 10}] % - 2.0/Pi {0.070487, 0....
user avatar
  • 6,530
6 votes

How to write down a product with omitted terms?

Long form: Product[(ρ[i] - ρ[j]), {i, 1, m}, {j, i + 1, m}] Product[(ρ[i] - ρ[j]), {i, 1, m}, {j, 1, i - 1}] By observing that each factor occurs twice (up to ...
user avatar
6 votes

Smoother ways for setting up a Product function with j=0 and j != i

Just for fun, here all functions $l$ in one go as a vector l: ...
user avatar
6 votes

Smoother ways for setting up a Product function with j=0 and j != i

You can always directly supply an edited index list to Product[]: ...
6 votes
Accepted

How to plot multifactorial function?

The immediate cure is to instead use the Chebyshev polynomial of the second kind, $U_n(x)$, in the definition: ...
user avatar
6 votes

How to type following expression in Mathematica

Product[x[a]/(b - a), {a, Range[3]}, {b, Complement[Range[3], {a}]}] -(1/4) x[1]^2 x[2]^2 x[3]^2
user avatar
  • 33k
5 votes

Calculate PDF and CDF of a product of independent exponentially distributed random variables

The Problem Let $(X_1, \dots, X_n)$ denote independent and identically distributed variables, each with common Exponential pdf $f(x)$: ...
user avatar
  • 8,451
5 votes

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

You might try this: FindInstance[{j > 0, i > 0, 1/j + 1/i == 3/10}, {j, i}, Integers, 10] This paper on page 19 proves that there are only 4 (counting ...
user avatar
  • 2,618
5 votes
Accepted

hermitian matrix-vector product does not give real result

I feel kind of dumb, but I found the answer to my own question in Mathematica's documentation. The function ComplexExpand is what I should be using. Doing ...
user avatar

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