Estimating the error of an iterative sequence

Click For Summary

Homework Help Overview

The discussion revolves around estimating the error of an iterative method used to find the square root of a number within the context of quantum circuits. The original poster describes their approach using substitutions and manipulations to derive an iterative formula, but they express difficulty in understanding the error analysis associated with their method.

Discussion Character

  • Exploratory, Assumption checking, Mathematical reasoning

Approaches and Questions Raised

  • Participants explore the relationship between the iterations and the error, discussing how to represent the error in terms of known variables. They raise questions about the validity of approximations and the implications of different initial values on the error estimates.

Discussion Status

Several participants have provided insights and suggestions regarding the error analysis, indicating that there are multiple interpretations of the problem. The original poster acknowledges the help received and is considering the implications of different cases for the error estimates. The discussion appears to be productive, with participants engaging in clarifying concepts and exploring various approaches.

Contextual Notes

There is an ongoing examination of the assumptions made regarding the initial values and the behavior of the iterative sequence, particularly in relation to the convergence and error bounds. The original poster is navigating through these complexities without a definitive resolution yet.

jeku1987
Messages
3
Reaction score
0

Homework Statement



This isn't quite homework (though it's close), but I'm working on a quantum circuit and wish to implement an iterative method to find the square root of a number using elementary arithmetic operations (and without reciprocals). I've gotten most of it down, but the error analysis is kicking me hard in the teeth.

Homework Equations


I want to estimate the error of the following iteration that finds x:

Take [itex]x^2=a[/itex] where a is known (sort of; the QC would be calculating a bunch of possible a's in superposition via the inverse quantum Fourier transform/eigenvalue kickback, but that's not super relevant) and [itex]0< a <1[/itex], then make the substitutions of [itex]y=1-x[/itex] and [itex]b=1-a[/itex] to get [itex]2y=(b+y^2)[/itex]. You can turn this into [itex]y_{i+1}=\frac{1}{2}(b+y_{i}^{2})[/itex] which converges monotically, and converges for any [itex]y_{0}[/itex] between 0 and 1. So far, we're gravy.

The Attempt at a Solution


Now if we subtract y from both sides, we get
[tex]y_{i+1} - y = \frac{1}{2}(y_{i}^{2} - y^{2})[/tex]
And after some manipulation, along with some blindly-added absolute value signs, we end up with
[tex]\left | y_{i+1}-y \right | = \frac{1}{2} \left | y_{i}-y \right | \left | y_{i}+y \right |[/tex]
Here's the meat of my issue; I want [itex]\left | y_{i+1}-y \right | < \varepsilon[/itex] and to get there my intuition says to take some delta such that [itex]\frac{1}{2}\left | y_{0}-y \right | < \delta[/itex] which would lead to [itex]\left | y_{i}-y \right | < \delta^i\left | y_{0}-y \right |[/itex]

But at this point I'm kind of getting lost in all of the details of the individual parts and can't really step outside very well to see the Big Picture. How can I represent the error of the iterations in terms of things that I know (which in this case, I think is only going to be [itex]a[/itex])? And I don't know where to go from here, is anyone well-versed in error estimation? Or analysis? Am I done here, or are there more steps to go?

Any and all help is, of course, immensely appreciated.
 
Physics news on Phys.org
With the assumption that ##y_i \approx y## after a few steps,
$$\frac{|y_{i+1}-y|}{|y_{i}-y|} \approx y$$
Therefore:
$$\frac{|y_{i+n}-y|}{|y_{i}-y|} \approx y^n$$
Using ##|y_{i}-y|<1## and ignoring the first steps,
$$|y_{i+n}-y| < y^n$$
If yi is smaller than y, this approximation is valid, otherwise it might depend on the initial value.

A more conservative estimate (using just yi<1) leads to
$$|y_{i+n}-y| < \left(\frac{1+y}{2}\right)^n$$
 
jeku1987 said:

Homework Statement



This isn't quite homework (though it's close), but I'm working on a quantum circuit and wish to implement an iterative method to find the square root of a number using elementary arithmetic operations (and without reciprocals). I've gotten most of it down, but the error analysis is kicking me hard in the teeth.

Homework Equations


I want to estimate the error of the following iteration that finds x:

Take [itex]x^2=a[/itex] where a is known (sort of; the QC would be calculating a bunch of possible a's in superposition via the inverse quantum Fourier transform/eigenvalue kickback, but that's not super relevant) and [itex]0< a <1[/itex], then make the substitutions of [itex]y=1-x[/itex] and [itex]b=1-a[/itex] to get [itex]2y=(b+y^2)[/itex]. You can turn this into [itex]y_{i+1}=\frac{1}{2}(b+y_{i}^{2})[/itex] which converges monotically, and converges for any [itex]y_{0}[/itex] between 0 and 1. So far, we're gravy.

The Attempt at a Solution


Now if we subtract y from both sides, we get
[tex]y_{i+1} - y = \frac{1}{2}(y_{i}^{2} - y^{2})[/tex]
And after some manipulation, along with some blindly-added absolute value signs, we end up with
[tex]\left | y_{i+1}-y \right | = \frac{1}{2} \left | y_{i}-y \right | \left | y_{i}+y \right |[/tex]
Here's the meat of my issue; I want [itex]\left | y_{i+1}-y \right | < \varepsilon[/itex] and to get there my intuition says to take some delta such that [itex]\frac{1}{2}\left | y_{0}-y \right | < \delta[/itex] which would lead to [itex]\left | y_{i}-y \right | < \delta^i\left | y_{0}-y \right |[/itex]

But at this point I'm kind of getting lost in all of the details of the individual parts and can't really step outside very well to see the Big Picture. How can I represent the error of the iterations in terms of things that I know (which in this case, I think is only going to be [itex]a[/itex])? And I don't know where to go from here, is anyone well-versed in error estimation? Or analysis? Am I done here, or are there more steps to go?

Any and all help is, of course, immensely appreciated.

From your iterative equation, if ##y_i \leq y## then also ##y_{i+1} \leq y##, so
[tex]|y_{i+1}-y|= \frac{1}{2}|y_{i}- y| |y_i + y| \leq \frac{1}{2} |y_i - y|\, 2y,[/tex]
so ##|y_{i+1}-y| \leq y\, |y_i - y|##, hence ##|y_i - y|## is dominated by ##c y^i##.

The case ##y_i > y## is trickier; we have that ##y_{i+1} > y## also, but getting a nice ##y_i##-independent multiplier ##k \in (0,1)## with ##|y_{i+1}-y| \leq k \,|y_i - y|## is trickier. I think it can be done, but I will leave the rest to you.
 
First, thank you both so very much! I've been struggling to look at this in so many different ways because analysis isn't my strongest suit, and your (in hindsight, simple) suggestions to let [itex]\frac{1}{2}|y_{i}-y|\rightarrow \frac{1}{2}2y[/itex] is exactly the hint I needed. HOWEVER, I'm having trouble seeing that the error estimate would have to be different for the cases of [itex]y_{i}<y[/itex] and [itex]y_{i}<y[/itex].

Ray Vickson: because knowing what the problem is can be half the battle sometimes, when you say it'll be trickier finding a multiplier such that [itex]|y_{i}-y|\leq k|y_{i}-y|[/itex] when [itex]y_{i}>y[/itex], is that because [itex]k>1[/itex] for all i (even if just barely) if we take [itex]k=\frac{1}{2}|y_{i}+y|[/itex]? Is that the meat of the issue here?mfb: I love the breakdown you gave, and I agree that [tex]\left ( \frac{1+y}{2} \right )^{n}[/tex] shrinks as n increases, but is that result derived from anywhere? Or is it just something you know that works from experience?

And again, thank you both very much for all your help thus far.
 
jeku1987 said:
HOWEVER, I'm having trouble seeing that the error estimate would have to be different for the cases of [itex]y_{i}<y[/itex] and [itex]y_{i}<y[/itex].
Those cases are hard to separate, indeed :wink:.

mfb: I love the breakdown you gave, and I agree that [tex]\left ( \frac{1+y}{2} \right )^{n}[/tex] shrinks as n increases, but is that result derived from anywhere? Or is it just something you know that works from experience?
You can derive it in the same way I did this for yi<y, using yi<1 instead.
Experience? I never saw that algorithm before.
 
Ahhhh I see what you were saying now. And I just meant experience with error estimation more generally sorry, my use of pronouns went dumb for half a tick.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 18 ·
Replies
18
Views
3K
Replies
1
Views
2K
Replies
7
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 3 ·
Replies
3
Views
1K