Listing the Q-bfs Polynomials

  • 14 September 2023
  • 22 replies
  • 511 views

Userlevel 4
Badge +1

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.

 


22 replies

Userlevel 7
Badge +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 4
Badge +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 4
Badge +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
Badge +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 4
Badge +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
Badge +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
Badge +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
Badge

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
Badge +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
Badge +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

 

Userlevel 4
Badge +1

Mark,

I’m with you in suspecting that orthonormality isn’t all that useful for optimization.  That’s because the minute you use more than one surface, the orthonormality breaks down due to cross terms.

For manufacturing, my spies tell me that orthonormality is critical.  They measure the asphericity and shape and try to decide what to do next in terms of polishing.  For the Q-types, because they’re orthonormal, they can figure out which term contains the most asphericity, and work on fixing that shape.  For Even Aspheres, the asphericity might occur in a mixture of terms, and it’s not quite clear what to do next.(!)

Also, check out our SSLP and DSLP operands for constraining slope at specific locations, and max and min surface slopes.!  SSAG and DSAG can be used to get the asphericity directly, too:

 

Userlevel 7
Badge +3

Can you do that with Zernikes too, as they’re also orthonormal?

Also, is that (polishing method) intended for high budget things like telescope primaries, or for high-volume optics? I can’t quite visualize how that works, are there any references to it?

And yes, there are lots of ways to constrain surface sag, slope and curvature in the merit function. I just never could see how that was the product of the surface description. The exact same surface profile can be defined using even aspheres, Zernike's, extended aspheres, Q-types etc. If A=B, then B=A after all.

At least with Chebyshev polynomials there is a clear, singular benefit: as you extend the aperture out from the clear semi-diameter, the surface doesn’t fly away like all the other surface types do. That’s the kind of thing I can really get behind. That’s what’s always been missing for me with the Qs: a single, clear, explicable benefit that doesn’t rely on hearsay. The Qs have always been a bit Emperor’s New Clothes for me 😀

Userlevel 4
Badge

In Zemax implementations, one advantage of the Q aspheres on the even (and odd) aspheres which can help in manufacturing and metrology is the presence of a normalization radius. When high degrees are present (e.g., mobile phone lenses), the even (odd) aspheres coefficients can go wild (very high values with alternating positive and negative signs). This can be the source of errors because of the limitations in computer precision (or when writing the lens specification and not including 14 decimals). It relates to the Wilkinson polynomial  (https://en.wikipedia.org/wiki/Wilkinson%27s_polynomial).

Optimization algorithms (which are also used for fitting) often need to generate a “small” change in parameters (for example to compute a derivative). Many use similar values for all parameters, but this expects all parameters to have a comparable magnitude of influence on the result.

In some cases, the reported limitation of the even and odd aspheres comes down to this and not to the (lack of) orthonormalization.

The workaround in Zemax is to use Extended Asphere instead. It’s not a fundamental weakness, just an implementation one.

Userlevel 7
Badge +3

Hi Ray,

The problem is that when you look at the Q-terms, you see exactly those alternating sign high order aspheres:

You aren’t getting rid of them, you’re just representing them via a different polynomial. But it’s the same underlying polynomial. Remember that Qs and even aspheres (and extended aspheres) all optimize to the same solution within some small delta, and there is no characteristic benefit. This is why, despite all the hand-waving about polynomial coefficients competing, that no-one can produce a test case that actually shows a benefit to using Q-types. It’s all hat and no cattle, as the Texans say.

I remember an episode of Penn and Teller’s great Bullshit show, where they took a banana, cut it in half, and told people that one half was organic and the other half was a (presumably) conventional banana. Everyone said the organic half tasted better. But it was the same banana!

So take an aspheric lens, cut it in half and call one half the Q-asphere and the other the even asphere. Which one optimizes better? Which one tolerances better? How could you tell the difference? It’s the same sag!

Userlevel 3
Badge +4

I’ve heard lots of great things about Forbes polynomials from a design point of view.  However, I find several outstanding issues in using Forbes polynomials (and many other aspheres):

  1. Forbes polynomials in OpticStudio cannot make arbitrary aspheres (e.g. free-form surfaces)
  2. Forbes polynomials cannot map easily to the coefficients required by manufacturing tools (they need to be converted by somebody to even order aspheres)
  3. Forbes polynomials don’t provide insight into inflection points, concave radii of curvature and other limitations in small tool polishing

Any ideas regarding how to address these?

Userlevel 4
Badge

Hi Brian,

Any new representation will take time to trickle to all software in the chain.

Regarding point 2, Zemax has had this implemented for quite a while

For point 1, there is a non rotation-symmetric extension of Forbes polynomials (if your shape has a symmetry, it’s not truly a freeform). I am not sure what they bring compared to the other  methods to represent freeforms (XY polynomials, Zernike polynomials, Chebyshev polynomials, NURBS, ...). Note that none of these, can create arbitrary shapes in practice (because they would require way too many parameters). It’s just that their capabilities differ. The composite surface allows to play on each base’s strength.

For point 3, again, Forbes polynomials do not differ from the others. Having perhaps more specialized optimization operands in that field could help.

 

[edit: 2 typos, 1 missing word]

Userlevel 3
Badge +4

Understood and appreciated.  As I build more aspheres, I see more constraints.

Often I use Zernikes for rotationally symmetric because they are somewhat band limited (slope and mid-spatial frequency limited).  But there is no conversion from Zernikes to Even Aspheres (e.g. if you use spherical Zernikes).

I also use Zernikes for freeforms because they are band limited and allow for arbitrary shapes that are non-rotationally symmetric.

I see that small tool polishing has a radius of curvature limit for concave sections of parts, as does diamond turning.  This is difficult to express in the merit function.  It would be useful to have the merit function align with manufacturing techniques.

There are polynomial / meshfree approaches to arbitrary shapes that are easy to code (link).  They can be used to control curvature easily but I’m not sure if they achieve optical performance.

Userlevel 7
Badge +3

I’ve always thought that the term ‘freeform’ should not be used when the surface is described by a known function, as the surfaces are never really freeform: they can only take some set of shapes. I think the current usage of ‘freeform’ is that there is no vertex-based reference that can be used as a proxy for a quick-n-dirty first approximation.

I greatly prefer OpticStudio’s TrueFreeForm as an approach that is genuinely capable of providing surfaces that cannot be described analytically at all. That of course raises its own set of issues, as we all want to be able to describe our freeforms with a small set of data.

Further, I think we should distinguish the surface description from constraints on the surface. SCUR for example can be used to provide constraints on many manufacturability issues. The smallest radius of curvature that a tool can make is the upper limit of the curvature of that surface, for example.

  • Mark
Userlevel 3
Badge +4

Definition of “Freeform” - I defer to the literature.  For example:  Jannick Rolland’s group (Roadmap for the unobscured three-mirror freeform design space).  The define freeform as something that can be represented by Zernikes that is not rotationally symmetric.

See also CEFO (The Center for Freeform Optics).  Here they refer to it as:


ISO standard 17450-1:2011, has no translational or rotational symmetry about axes normal to the mean plane

 

Userlevel 3
Badge +4

Rather than use SCUR, which provides that absolute value of the curvature, I use SDRV which provides a signed value where I can determine if it is concave or convex.

However, at present, I still need to:

  1. Define the sampling across the clear aperture with individual entries for each evaluation
  2. Include a separate Merit Function entry for OPGT or OPLT to evaluate the curvature

If OpticStudio is looking to add features that distinguish itself from the competition and simultaneously drive value that reduces effort in workflow, I advocate for optimization that is related to manufacturing.

In my efforts, I can’t see how to use PanDao to select a vendor and make a more practical design.  Can you?

Userlevel 7
Badge +3

I don’t think SCUR does provide only the absolute value. It provides the signed value. There may be something suspect in your file that needs examining.

On the definitions, yes I concur. I just don’t see why not being rotationally symmetric makes it ‘freeform’...probably to do with glamorizing the work to get funding 😀 But as I’ve always worked with the surface definitions, one surface definition is pretty much like another to me: the status of the IsSymmetric flag isn’t enough for me to consider the surface freeform. But I get that I’m in a minority of 1, again.

Userlevel 7
Badge +3

BTW, I asked on this forum if anyone was using PanDao and what they thought of it, but it got deleted by the site admins. I’m personally a bit underwhelmed by PanDao, despite the glowing reviews they post on their website about it. 

I’ve not yet heard from anyone who has bought and paid for it, as to what they think. I’d really like to hear what paying customers say.

  • Mark

Reply