What shape lens will focus parallel laser beams to the smallest point? I'm playing with Algodoo optics. I'm trying to focus parallel lasers using refraction. I thought an ellipse or parabola would work, but not precisely.  As you can see in this picture, the ellipse focuses the outside beams too near, and the parabola focuses them too far.  I guess the perfect lens is in between these two.  What is the cross section formula of a perfect lens? Or if this is a bug in Algodoo, I'd like to know that.

EDIT:
Based on the suggestion by mmesser, I created an ellipse and adjusted the eccentricity so that all beams are refracted to the far focal point of the ellipse. Then I cut away the ellipse with a circle centered on that focal point.  This technique can be scaled to produce a perfect meniscus lens for any  refractive index and desired focal length. I tried the same using a parabola and it does not work, because there is no internal focus point.

I didn't prove this rigorously.  maybe I'll try tomorrow.
 A: If you want to bring parallel rays to a perfect geometric focus inside the glass, a parabola would be the choice.
Then you want the second surface to not change the rays so they continue to the same focal point. Make the second surface a sphere centered on the focal point.
In practice, you don't do that because spherical surfaces are much easier to manufacture than non spherical surfaces. And for the gentle curves of most lenses, the difference between a parabolic surface and the closest spherical surface is typically a few wavelengths of light. This makes errors small. You can compensate for the errors with the other surface. See the Hyperphysics topic on Spherical Aberration
A: I got some time so I proved it, perhaps not rigorously, but graphically using Desmos.  If Snell's Law is correct, then a parabola certainly does not bring parallel rays to a perfect geometric focus, no matter what shape the parabola has.  See proof.

However, an ellipse does bring parallel rays into a perfect geometric focus, but only if the shape of the lens and the refractive index of the material conspire together to focus the rays at the geometric focal point of the ellipse.  See proof.

Of course this requires b >= a. In other words, the light must enter the elliptical lens along the major axis and focus inside the lens.
If it is not desirable to focus inside the lens, then the lens may be carved away using a spherical surface centered at the focal point (see edit in OP).
