# Listing the Q-bfs Polynomials

• 10 replies
• 75 views

Userlevel 3 +1
• Zemax Staff
• 9 replies

OpticStudio supports Q-type aspheres.  Type 0 indicates Qbfs polynomials, and Type 1 indicates Qcon polynomials.  The functional forms of the Q-type polynomials are fairly complex due to the requirement that the polynomials be orthonormal for a circular aperture.  Occasionally, it is convenient to know the functional form of the polynomials for testing and comparison purposes.

Below, we list the first 10 Qbfs polynomials, and also share how to calculate them in the Mathematica file GenerateQbfsPolynomials.nb.  The .nb files for Mathematica can be used by downloading the free Wolfram Player: https://www.wolfram.com/player/.

# Important equations for the Q-bfs polynomials

The equations used below come from Shape specification for axially symmetric optical surfaces, G.W. Forbes, Optics Express 5218, Vol. 15, No. 8, 16 Apr 2007.  Forbes watned to find a function whose slopes are orthogonal.  So the slope equations must obey:

where u is the radial coordinate in the aperture of an optical surface, and d­mn is the Kroeneker delta function, which is 1 when m = n and 0 for all other m and n.

The weighted average indicated by the angled brackets above is defined as:

Forbes suggests choosing a weighting function that will enforce well-behaved slopes at the center and edge of an aperture, so that the weighting value is high when u = 0 and u = 1.

This choice of weighting gives a denominator in the weighted average of pi/2:

Forbes chooses the slopes as a set of general polynomial terms, which he calls the Q-bfs polynomials:

I'll just use a generic form for the the Q-bfs polynomials, initially, so:

….etc.

And the orthogonality requirement gives systems of equations so that we can solve for the values of the coefficients.

For the first term, m = 0 and orthogonality condition is already satisfied:

For m = 1, two conditions must be satisfied, so we have two equations and two unknowns coefficients:

and in integral form using the definition of the weighted average above, the two equations are:

Solving the system of equations for a10 and a11 gives:

and the complete Qbfs polynomial is then:

The polynomials that follow can be calculated in the same way.  For m = 2, we have three equations and three unknown coefficients:

so we can solve for the coefficients to determine the complete polynomial, and so forth, for all the remaining polynomials.

# Listing of the Qbfs polynomials

The first 6 Qbfs polynomials are listed below.

# Calculating the Qbfs polynomials

The attached Mathematica file, GenerateQbfsPolynomials.nb can be used to calculate any of the Qbfs polynomials.  The .nb files for Mathematica can be used by downloading the free Wolfram Player: https://www.wolfram.com/player/.  A .pdf version of the file is also attached to this article.

### 10 replies

Userlevel 7 +3

I’ve got to admit that I’ve never liked the Forbes aspheres for their horrible complexity. I know they are orthogonal and use normalized coefficients, but sheesh! Give me a polynomial whose coefficients I can write down. Zernike polynomials are bad enough!

• Mark
Userlevel 3 +1

Agreed about the complexity.  A few people in the field have told me that the orthogonality is pretty handy, though, especially for polishing, and I do like that the RMS and slopes just fall out of the coefficients.

Userlevel 3 +1

Also, this is the kind of analytic work that makes me really love Mathematica.  It’s so useful for anything concerning analytic equations.

Userlevel 7 +3

Hi Erin!

Can you tell me more about “I do like that the RMS and slopes just fall out of the coefficients”?

• M
Userlevel 3 +1

Mark - Maybe you could e-mail me, so that I don’t have to put my tenuous grasp of this subject on public display quite yet.  😆

Userlevel 7 +3

I know exactly what you mean. Will do.

I have huge respect for Greg Forbes, and his insights in applying Gaussian Quadrature to optical design alone is enough to induct him into the Optical Design Hall of Fame. But I have never grasped the utility of his aspheric formalism. Nobody has ever given me a clear, simple explanation as to why the things the Q-coefficients do matter.

It’s true that when you optimize, the particular polynomial form you use for the surfaces affects the route the optimizer takes in coming to a minimum. But it’s far from clear to me that the Qs are inherently superior. If you set up a cell phone design with even aspheres and optimize, then with extended evens and optimize, then with Zernikes and then optimize, or with Qs and then optimize, or with Jose Sasian’s pedal surface and optimize, you can’t predict which one will come to a better solution.

By all means give them a try, but in all my tests the only conclusion I have come to is that the Qs are slow and cumbersome, but get to the same point within some +/-.

Change my mind 😀

Seriously, I’d really like to have a discussion with people who have used it and obtained results they would not have gotten otherwise. I just don’t understand the hype.

• Mark

Userlevel 6 +2

Hey Mark,

I love these high level discussions!

From a design standpoint, a really cool aspect of the orthogonality of Q-Types is that changing the A2 coefficient has no effect on the A1 coefficient whereas changing the r^4 term for a polynomial (Even Asphere) directly affects the r^2 term (and all others).  This is often why you’ll see aspheres with crazy conics (in the 100’s) and using really large terms to try to balance the other terms.  Basically, polynomial coefficients fight each other whereas Q-Types simply get along with each other and there’s no competition 😀.

From a tolerancing standpoint, Jannick Rolland from UR’s CeFO has done some really cool work in terms of the manufacturing benefits of Q-Types:

Applying slope constrained Q-type aspheres to develop higher performance lenses (optica.org)

Since these polynomial terms fight each other and you often need significant digits beyond what the machine/metrology can handle, it’s difficult to get high performance with Even Aspheres.

In terms of “directly controlling the slope” with Q-Types, just like with TEZI and using the scaled RSS of all the coefficients to get the rms deviation for a Zernike, a similar calculation can be made with the Q-Type coefficients for the slope of the part.  The lower slope leads to easier metrology & less sensitivity designs during assembly.  Having a lower slope for the Q-Type is analogous to the Moore-Elliot optimization where minimizing the wavefront slope maximizes the MTF (since Erin’s on this thread, I wanted to give a shoutout to MECO).

With all that said, I still use Even Aspheres just due to legacy designs and workflows but if a Q-Type operand could be developed which would minimize the RMS slope of the asphere (for sensitivity) and  another operand for peak spherical departure (for metrology), Q-Types could be really cool in OpticStudio.

Userlevel 4 Hi Mark,

The Qbfs are quite complex but the Qcon are actually very simple, and you can convert them to usual polynomial form very easily, e.g. in Excel (or with a few lines of Matlab). Also, Qcon asphere is really compatible with the even/odd asphere formula.

I have used Qcon in surface fitting as the orthonormality makes a huge difference in convergence for fitting algorithms. At the end, I converted back to usual form.

Userlevel 7 +3

Hey Michael,

Thank you for the link to the paper by Ma et al. I’m going to read this more thoroughly, but on just a quick review I see they state that using the Q or non-Q surface types does not significantly affect the optimization. That tracks with my experience in building test cases: I could not produce a test case that was significantly better with Q or non-Q surfaces. All I found was that Q took longer.

{BTW, for all the benefits of orthogonal coefficients versus non-othogonal, it does not seem to make any difference to the optimization results. My private belief is that this is because the optimizer tries to orthogonalize the variables in any case. There’s a lot of literature on Single Value Decomposition in optimization, and this is implemented in every major ray-tracer’s optimization code. I believe that this part of the claims for Q-types is a non-issue.}

I’ll need to think more about the tolerancing case. The case cited by Ma is a legitimate but edge case: it’s a very complex lens. I wonder why they could not use a simpler case to illustrate their point. The bit I don’t get is that manufacturing errors are simply not conveniently orthogonal...I’m failing to grasp something fundamental here

@Ray, I take your point that orthonormality makes curve fitting easier. That said. one can convert any Q-type into an even asphere, and vice versa. There is no surface shape that one can represent that the other cannot.

I’ll need to think more on the tolerancing case. But, do note that you can control sag, slope and curvature already with existing operands.

Thanks for the discussion!

• Mark
Userlevel 7 +3

Hey Michael,

The Ma et al paper is really good, but I don’t think it’s doing what I’m referring to. In section 2.2 they say:

The purpose of this optical design study was to compare solutions developed using Q-type aspheric departure surfaces optimized without slope constraints and Q-type surfaces optimized with aspheric slope constraints.

In other words, they are optimizing the Q surfaces with and without the slope constraints. With slope constraints is better for manufacturability, and I totally get that. BUT, you don’t need the Qs for that. Slope constraints can be added to any surface type: even asphere, Zernike, superconic, whatever. In section 3, they say

An optimization based in a Q-type was found to take similar time, with and without the slope constraints. However in the case of the slope constraint solution, the impact on the time to assemble a specification compliant system is reduced, potentially substantially.

In other words, the benefit comes from the slope constraint, not the surface type. Now Ma et al used Code V, so they are coy about revealing exactly how the slope constraint was implemented, but in OS one would use operands like BFSD

That would seem to me to do everything you ask for when you say:

With all that said, I still use Even Aspheres just due to legacy designs and workflows but if a Q-Type operand could be developed which would minimize the RMS slope of the asphere (for sensitivity) and  another operand for peak spherical departure (for metrology), Q-Types could be really cool in OpticStudio.

Am I missing something?

I’m sorry to bang on about this, and there’s probably only Ken Moore and me in the world who care about this, but it still seems to me that the ‘benefits’ of Q-types are really not related to the surface at all, but to the optimization operands used to control the resulting shape. Or, again, am I missing something?

• Mark