# What functions can one try employing to fit an apparently doubly-periodic real function over $[0,1]$?

I have a cosine-like data curve over $x \in [0,1]$ that I can rather well-fit by a function of the form $a \cos{2 \pi x} +b$. Although good, the fit is still lacking, in that the residuals from the fit have something of the form $c \sin{4 \pi x} + d$, where $c$ is considerably less than $a$, and $d$ less than $b$. So, I think that I should explore the use of doubly-periodic functions to fit my data. Is this sufficient information, for possible candidate families of functions (elliptic...) to be suggested, the use of which I could explore? (I am a Mathematica user.)

This question arises in a quantum-information-theoretic/random-matrix context, in trying to employ eq. (24) $$\label{JointBuresHSformula} \rho_x= \frac{(y \mathbb{I} +x U) AA^{\dagger}(y \mathbb{I}+x U^{\dagger})}{\mbox{Tr} (y \mathbb{I}+x U) A A^{\dagger} (y \mathbb{I} +x U^{\dagger})},$$ in the paper "Random Bures mixed states and the distribution of their purity" of Osipov, Sommers and Zyczkowski https://arxiv.org/abs/0909.5094. ($U$ is a random unitary matrix and $A$, a Ginibre matrix.) This formula provides an interpolation between random density matrices ($\rho_x$) with respect to the Hilbert-Schmidt and Bures (minimal monotone) measures ($x$ being the interpolating variable).

I am interested in exactly determining the ($x = \frac{1}{2}$) Bures "separability probability" ($\approx 0.0733$) of two-qubit ($4 \times 4$ density matrices), while the Hilbert-Schmidt separability probability ($x=0,1$) already appears to be exactly known (that is, $\frac{8}{33} \approx 0.242424...$, https://arxiv.org/abs/1701.01973). Each random density matrix generated in accordance with the formula is tested to see if it satisfies the "Peres-Horodecki" partial transposition test for separability. If it does, it contributes to the total separability probability.

For a related/background posting, entitled "Estimate/determine Bures separability probabilities making use of corresponding Hilbert-Schmidt probabilities", see https://quantumcomputing.stackexchange.com/questions/2740/estimate-determine-bures-separability-probabilities-making-use-of-corresponding

Per the comment of მამუკა ჯიბლაძე, I am inserting an image of my "cosine-like data curve" (based now preliminarily on 740,000 random realizations). (Note the $\frac{8}{33}$ fit at $x =0, 1$.)

Here, additionally, is a plot of the (sine-like) residuals resulting from subtracting from the above data curve a fit of $\frac{1}{66} (5.29209 \cos (2 \pi x)+10.7079)=0.0801832 \cos (2 \pi x)+0.162241$.

This is now a plot of the two indicated curves

So, to reiterate, I am interested in suggestions of classes of models (presumably with some random-matrix pertinence) that might fit these data--the goodness of fits of which, I could then investigate. (The "Holy Grail" of this research program is the exact value [$\approx 0.0733$] of the Bures [$x =\frac{1}{2}]$ separability probability [https://arxiv.org/abs/quant-ph/0308037, and subsequent literature].)

• Your function is not doubly periodic: There are not independent real numbers $\alpha, \beta$, such that $f(t)=f(t+\alpha)=f(t+\beta)$. Over the reals, doubly periodic functions are either constant or highly pathological, e.g. nowhere continuous. What you describe looks more like a quickly converging Fourier series. Also the appearance of $d$ looks strange: If you determined $b$ correctly, then $d$ should be 0. – Jan-Christoph Schlage-Puchta Aug 28 '18 at 20:55
• Reiterating parts of @Jan-ChristophSchlage-Puchta's comment: the keyword "doubly-periodic" is not what you want, despite the obvious colloquial possible interpretations in the direction you're thinking. The phrase was already committed to a different idea 200 years ago, and just refers to something else. So, not elliptic functions, either, which are doubly-periodic in the sense that it not immediately relevant to your issue... – paul garrett Aug 28 '18 at 22:44
• ... so you should just look at "ordinary" Fourier expansions for periodic (not doubly-periodic...) functions, to address the beginning part of your question. Then I'd recommend a rewrite/revision of the later part, to fit into expectations for this site. You might also want to revise-and-repost to MathStackExchange, before coming back here, since the purely mathematical issues of your problem are not at all clear at this moment, and some relatively elementary things need cleared up. – paul garrett Aug 28 '18 at 22:46
• Thanks for above comments! So, "doubly-periodic function" is not the relevant concept in this context. I had thought of an (ad hoc) Fourier expansion, but suspect that the answer is something of a more "holistic/elegant/surprising" form. The desired function is symmetric about $x =\frac{1}{2}$, so perhaps I should just concentrate on modeling it over $x \in [0, \frac{1}{2}]$, and not emphasize the periodic characteristics. – Paul B. Slater Aug 29 '18 at 0:42
• Could you provide a graph of your data? – მამუკა ჯიბლაძე Aug 29 '18 at 4:51