Paul Zsombor-Murray

TANGENCY AMONG THREE CYLINDERS A HYPERBOLOID AND A TORUS

Keywords: Cylinder, Hyperbola, Torus, Tangency ....

A challenging exercise in solid modeling is examined and developed as an opportunity to raise students' consciousness in "geometric thinking" by considering how to extract additional, required design parameters from an initial specification. This involves the formulation and solution of a variety of problems in analytical geometry and inevitable digression into some simple application of polynomial discriminants and the notion that pitfalls as well as advantages accompany symmetric configuration.

SOLID MODELING A TABLE

Look at Fig. 1. The problem at hand is to extract the necessary design information from the following specifications so that a 3D model of this small patio cocktail table may be assembled from five simple parts, very easily constructed individually with "Solid Works" once the design information is available.

• The table top is a 500mm diameter by 25mm thick disc and sits on

• Three legs that are cylinders of 50mm outer diameter and inclined at the angle of the sloping edges of a regular tetrahedron with one base horizontal.

• Legs mutually touch, each pair on a point at half their total sloping leg height, i.e., legs are beveled at an angle so their elliptical ends lie in horizontal planes on the bottom of the table top and the floor.

• Vertical distance between floor and under surface of table top is 500mm.

• A ring in the shape of a torus or "perfect doughnut" holds the legs together and touches them. The smallest circular section of this torus has a diameter of 50mm.

The task will be to map the elliptical footprints of the legs onto the under surface of the table top and to the floor and to find the inner radius of the "doughnut hole".

Figure 1: A Round Table with Three Legs Held by a Ring

Expectation

The student is expected to produce and deliver:-

• A nice CAD drawing of the hyperbola and the minor circular torus section, of radius R, in tangency as was done in the circle and ellipse in Fig. 5,

• An analysis to find the minor (meridian) circle centre radius x 2 of the torus and the points of tangency of this circular section with the hyperbola on the axial section of the hyperboloid swept by the table legs and

• Of course, the entire five piece solid model.

NEAT DESCRIPTIVE GEOMETRY

The region where the three legs and torus touch are described constructively in the top and elevation view drawing shown in Fig. 2 while Fig. 3 shows one of the leg axes in end or point view. These three illustrations, including Fig. 1, were taken from an article that appeared recently in IBDG [START_REF] Schröcker | Ein Vergleich von Lösungsstrategien für eine anspruchsvolle Modellieraufgabe (Comparing Approaches to Solving a Challenging Solid Modeling Problem)[END_REF]. These may help if you can read multiview scaled drawings and have learned a little descriptive geometry.

Touching Legs and Torus

Now the leg axis geometry and that of the hyperbolic external envelope of the legs will be addressed so that the legs and the torus can be constructed. First the mutual tangency of the three legs will be considered using two approaches. In the first, a conic coefficient matrix and its dual, cofactored form will be used. In the second, the relation between tangency and double roots is shown thus providing a simple introduction to discriminant methods. The enveloping hyperboloid will be found by identifying the ruling line, on a leg cylinder, that is furthest from the hyperboloid axis.

Slope of the Legs

To find the slope of the legs, from the specification that their cylindrical axes are parallel to three intersecting edges of a regular tetrahedron and their slope is the angle θ between an edge and the plane formed by the remaining two intersecting edges, imagine a unit cube with the three intersecting edges on its face diagonals thus.

OA, OB, OC, O(0, 0, 0) A(1, 1, 0), B(0, 1, 1), C(1, 0, 1)

n = AB × AC |AB||AC| = 1 √ 3 [-1 -1 -1] T u = 1 √ 2 [-1 -1 0] T
The inner product n • u = sin θ = 2/3 .

Leg Cotangency Conditions

Imagine that the three legs are already in their proper positions. Examining the layout in a top view projection like the upper illustration in Fig. 2. The equilateral triangle in the centre is reproduced in Fig. 4 and represents the three leg axis. Sectioning the legs with successive horizontal planes proceeding from the floor up one will eventually arrive at a level, exactly mid-way up, where the elliptical sections of the legs are cotangential. Only one such ellipse is shown in Fig. 4 but two other, congruent ones may be visualized with their major axes on the other two sides of the equilateral triangle. It is obvious that one need not consider ellipse tangency since the right bisectors of the triangle will more simply serve the same purpose. Now consider the ellipse in standard form as shown in Fig. 4 in the Cartesian frame on origin O and axes x 1 , x 2 . One knows the leg cylinder radius is b = 25mm and

sin θ = b a
where a is the ellipse semi-major axis length and θ is the slope angle of legs parallel to the concurrent edges of a regular tetrahedron, i.e., sin θ = 2/3 and a = 25 3/2mm. What is not known is w the distance between hyperboloid's axis of symmetry and any leg axis.

Coefficient Matrix and Cofactors

We have a situation where the five conditions necessary to define a conic, the ellipse in this case, include four tangent lines, p on points S and P , q on points P and Q, r on points Q and R and s on points R and S. Furthermore one knows that the point (not shown) T (0, -b) is on the too. In order to review principles used below, refer to [START_REF] Zsombor-Murray | Introduction to Conics and Quadrics[END_REF]. Consider the three conic coefficient matrices in the following expression.

  A 00 A 01 A 02 A 01 A 11 A 12 A 02 A 12 A 22   →   A 11 A 22 -A 2 12 A 02 A 12 -A 01 A 22 A 02 A 12 -A 01 A 22 A 00 A 22 -A 2 02 A 01 A 12 -A 02 A 11 A 01 A 02 -A 00 A 12 A 01 A 12 -A 02 A 11 A 01 A 02 -A 00 A 12 A 00 A 11 -A 2 01   ≡   a 00 a 01 a 02 a 01 a 11 a 12 a 02 a 12 a 22  
The first coefficient matrix is that of a conic tangent line equation, i.e., pre-multiplying it with a row vector of planar line coordinates and postmultiplying by the column vector produces the scalar line equation of the conic. Cofactoring produces the middle matrix, the coefficient matrix of the corresponding point conic with coefficients represented as a ij . With the four tangent line corner point homogeneous coordinates from Fig. 4 we get the four tangent line equation coefficients.

P {1 : 0 : w}, Q{1 :

√ 3w : 0} R{1 : 0 : -w}, S{1 : - √ 3 : 0} → p{ √ 3w : 1 : - √ 3}, q{ √ 3w : -1 : - √ 3} r{ √ 3w : -1 : √ 3}, s{ √ 3w : 1 : √ 3} (1)
Now the five constraint equations, Eq. 2, define the ellipse in terms of coefficients A ij .

p : 3w 2 A 00 + 2 √ 3wA 01 -6wA 02 + A 11 -2 √ 3A 12 + 3A 22 = 0 q : 3w 2 A 00 -2 √ 3wA 01 -6wA 02 + A 11 +2 √ 3A 12 + 3A 22 = 0 r : 3w 2 A 00 -2 √ 3wA 01 + 6wA 02 + A 11 -2 √ 3A 12 + 3A 22 = 0 s : 3w 2 A 00 + 2 √ 3wA 01 + 6wA 02 + A 11 +2 √ 3A 12 + 3A 22 = 0 T : A 11 A 22 -A 2 12 + 2bA 01 A 12 -2bA 02 A 11 +b 2 A 00 A 11 -b 2 A 2 01 = 0 (2)
Solving for A ij and cofactoring produces the ellipse point coefficient matrix, in a ij , on the right in expression 3, not surprisingly in standard form.

  -1 0 0 0 3(w 2 -b 2 ) 0 0 0 b 2   →   -3(w 2 -b 2 )b 2 0 0 0 b 2 0 0 0 3(w 2 -b 2 )   (3)
With row and column vectors of variable homogeneous coordinates of point X{x 0 : x 1 : x 2 } and with x 0 = 1 in Euclidean space the ellipse is given by Eq. 4.

-1 + x 2 1 3(w 2 -b 2 ) + x 2 2 b 2 = 0 (4)
Equating denominators of x 2 1 by definition as a 2 = 3(w 2 -b 2 ) gives w = ± (a 2 + 3b 2 )/3 .

Standard Form and Discriminant

An alternate approach to symmetrically placing the three coplanar, cotangential elliptical sections on equilateral triangle sides, formed by a top view projection of the leg cylinder axes, is now discussed. Since the solution is easily seen to simplify to a standard form ellipse with given minor axis length b and a tangent line, say, QR → r with given principal axis intercepts Q( √ 3w, 0) and R(0, -w), the ellipse and line, using the negative reciprocal intercept formulation described in [START_REF] Zsombor-Murray | Line Geometry Primer[END_REF], are presented in Eq. 5 in terms of three unknowns, x 1 , x 2 , a, where a is the semi-major axis length.

-1 + x 2 1 a 2 + x 2 2 b 2 = 0, 1 - x 1 √ 3w + x 2 w = 0 (5)
Eliminating x 2 between the ellipse and line expressed in Eq. 5 produces a quadratic in x 1 only.

(9b 2 + 3a 2 )x 2 1 -6 √ 3a 2 wx 1 -9a 2 (b 2 + w 2 ) = 0
This is differentiated with respect to x 1 (a 2 + 3b 2 )x 1 -√ 3a 2 w = 0 and x 1 is eliminated between the quadratic and its derivative yielding a function f (a, b, w) = 0.

324a 2 b 2 (a 2 + 3b 2 )(a 2 + 3b 2 -3w 2 ) = 0
The factor containing w is solved to again arrive at w = ± (a 2 + 3b 2 )/3 and with the given specifications w = a = 25 3/2mm.

2.6

From Ellipse to Hyperboloid Axis Fig. 5 shows the tangent circle of maximum radius, centred on the minor axis of the ellipse at distance w from its centre. A leg cylinder generator on such a tangent point is also a generator of the one sheet hyperboloid of revolution to which the torus is tangent. In fact, the circle is the throat circle of that hyperboloid. The standard form ellipse and tangent circle equations are written as Eq. 6.

-1+

x 2 1 a 2 + x 2 2 b 2 = 0, -r 2 +x 2 1 +(x 2 +w) 2 = 0 (6)
Eliminating x 2 produces a quadratic in x 1 . Taking its derivative with respect to x 1 yields a second, linear equation in x 1 . Solving these to eliminate x 1 gives the circle radius r and then simultaneous solution of Eq. 6 finds the two points that each support a cylinder-and-hyperboloid generator. The radius and tangent points are given by Eq. 7 where results are expressed as dimensionless ratios.

r 2 a 2 = 1 + w 2 a 2 -b 2 , x 1 a = ± 1 - wb a 2 -b 2 2 x 2 w = b 2 a 2 -b 2 (7)
Alas, although the solution above has been simplified so as to deal only with a quadratic equation, the intersection between two conics admits four solutions. Referring to [START_REF] Zsombor-Murray | Shortest Distance from Point to Coplanar Conic[END_REF] one sees a comprehensive development of this topic. In the solution Eq. 7 above the quartic

P x 4 1 + Qx 3 1 + Rx 2 1 + Sx 1 + T = 0
where Q = S = T = 0 has been represented by only the quadratic factor P x 2 + R = 0 that leads to a pair of imaginary solutions. The real, significant, double root (x 1 -0) 2 = 0 is omitted. In such cases where the circle centre point is on the ellipse minor axis x 2 = b. A pair of real roots emerges from the quadratic factor if θ is sufficiently small as in the arbitrary case illustrated in Fig. 5. The actual situation with the given design parameters that produce x 1 = 0 is summed up in Fig. 6 where

r = b + w = b + a = 25(1 + 3/2) .

Torus and Hyperboloid Tangency

First the axial hyperbolic section of the standard form one sheet hyperboloid of revolution with throat radius r given by Eq. 7 is configured as a planar projection on, say, x 1 = 0. This is done using the point X{x 0 : x 2 : x 3 } = {1 : r : 0} and an absolute point A{a 0 : a 2 : a 3 } = {0 : cos θ : sin θ} on the chosen plane of projection, x 1 = 0. The chosen hyperbola is written in Eq. 8 along with the coefficients derived with points X and A. Notice that α and β are used to represent the unknown conic coefficients since the more usual a and b were already used for the ellipse.

β 2 x 2 2 -α 2 x 2 3 -α 2 β 2 x 2 0 = 0 → x 2 2 α 2 - x 2 3 β 2 -1 = 0 x 0 = 1, α = r, β = r tan θ (8)
As in the case of finding the radius r of the circle that circumscribes the three mutually tangential elliptical sections of the leg cylinders, as shown in Fig. 6, one must find the location of the circular axis of the torus, a distance v from the hyperbola axis on x 2 = 0. The meridial circular section of the torus is of given radius R = 25mm and this circle (x 2 -v) 2 + x 2 3 -R 2 = 0 must be tangential to the hyperbola given by Eq. 8. If one chooses to eliminate x 3 between Eqs. 8 and the circle, two "right" answers are obtained, the first of the two pairs ±(α + R), ±(α -R), α = r. The second pair represents tangency of circles inside the hyperbola. If however R is sufficiently large or θ is sufficiently small then the solution produced by eliminating x 2 , that admits two separate points of tangency, applies, i.e., v = r 2 (1 + tan 2 θ) + R 2 (1 + cot 2 θ). Sections of an R = 25mm and an R = 200mm torus are shown on the right and left of the hyperbola pertaining to b = 25mm legs at slopes of θ = sin -1 2/3 are shown in Fig. 7.

Conic and Circle Tangency

Applying the analysis outlined in [START_REF] Zsombor-Murray | Shortest Distance from Point to Coplanar Conic[END_REF] to the configurations depicted in Figs. 5,6,7, where the circle is centred at P (0, ±p 2 , 0) and P (±p 1 , 0, 0), respectively, reveals the condition where the two contact points at ±x 1 and ±x 3 collapse to x 1 = 0 or x 3 = 0, respectively. This is expressed in terms of appropriate dimensionless ratios.

x 1 a 2 = 1 - bw a 2 -b 2 2 (9)
Eq. 9, essentially a reprise of Eq. 7, is devoid of radius r or R. As w is increased so that

w/a (a/b) -(b/a) > 1
then the single point contact applies and the inner radius of the torus is r = b+w and the circular axis of the torus is at x 2 = r +R for the given dimensional specification of the table leg configuration, i.e., b = R = 25mm and w = a = 25b.

GENERAL CONFIGURATION

Consider placing in mutual contact three cylinders of revolution of various given radii and axial directions. There is no loss in generality if one chooses the first cylinder axis to lie on the Cartesian frame axis x 1 . This axis is shown in Fig. 8 as segment AB of line P. The second cylinder axis on segment CD of line Q is separated from AB by common normal AC along the Cartesian frame axis x 3 . The third cylinder axis cannot be placed immediately but its direction is given by line segment AX. When AX is projected on a plane normal to this direction the two pairs of parallel ruling lines on the first two cylinders are shown to define the limits of these two cylinders. There are four possible locations for the circular section of the third cylinder. These are located by intersecting line pairs that are respectively parallel to a limit ruling of each of the first two cylinders and offset by a distance equal to the radius of the third cylinder. The third cylinder axis chosen is shown as segment EF of line R. Now the other two common normals GH and JK, connecting EF to AB and to CD, can be found and points P, Q, R placed on these and on AC. These three points are where cylinder pairs make contact.

Analytic Geometry

In what follows the axis of the third cylinder will be defined on the intersection of a plane pair. As in the case of offset lines on the plane of projection, above, there are four such planes that may be paired to locate four possible axes of the third cylinder. Fig. 9 shows three touching cylinders of different radius and, for clarity, with their axes mutually orthogonal. A sphere of radius equal to the sum of the radii of the second and third cylinders is placed anywhere on the axis of the second. Then a plane is shown tangent to the sphere and parallel to the second and third cylinder axes. Again, for clarity, this plane is not on the axis of the third cylinder but it is easy to imagine the two planes which are.

CONCLUSION

Apart from providing an interesting and challenging exercise in solid modeling this problem goes well beyond the issues of contacting cylinders and tori. Specifically, the robust and efficient computation of shortest distance between points in the plane and in space and conics and quadrics, respectively, is an active subject of modern research in image processing for precise camera aided inspection of industrial products, e.g., [START_REF] Harker | First Order Geometric Distance (The Myth of Sampsonus)[END_REF].

Figure 2 :

 2 Figure 2: Leg in True View and One-Sheet External Hyperbolid of Revolution

Figure 3 :

 3 Figure 3: End View of a Leg

Figure 4 :

 4 Figure 4: Triangle and Ellipse

Figure 5 :

 5 Figure 5: Hyperboloid Throat Circle

Figure 7 :

 7 Figure 6: Three Leg Sections on Torus Equator

Figure 8 :

 8 Figure 8: Three Contacting Cylinders of Various Radius and Axial Direction

Figure 9 :

 9 Figure 9: Three Contacting Cylinders, a Sphere and a Plane

ACKNOWLEDGEMENT

This research on exercises in Geometric Thinking is supported by a Natural Sciences and Engineering Research Council (Canada) "Discovery Grant".


Young-Gu Ju
email: ygju@knu.ac.kr

A scalable optical computer based on free-space optics using lens arrays and a spatial light modulator

Keywords: optical computer, optical neural network, free-space optics, smart pixels

A scalable optical computer based on free-space optics was proposed to obtain optical parallelism in an artificial neural network. The combination of lens arrays, a spatial light modulator, and a large-diameter lens can distribute the weighted input light to multiple detectors, which can add light from multiple inputs to achieve a linear combination optical engine. The nonlinear part of the neural network can be processed using distributed electronics, as in smart pixels. The proposed design was realised in hardware with 2×2 inputs and 2×2 outputs, using light-emitting diodes, a liquid crystal display, lens arrays, and a detector array assembled in an optical cage system with subsidiary electronics. The feasibility of the constructed optical computer was demonstrated by achieving the expected results of NAND and NOR logics in parallel in the non-difference mode. A simple pattern-checking function in the difference mode was also shown. The proposed architecture has the potential for realising massive optical parallelism if large array components and high-speed electronics are used in the future.

Introduction

Considerable effort has been dedicated over the last seven decades to create an optical computer that can process a large amount of data in real time [START_REF] Ambs | Optical Computing: A 60-Year Adventure Advances in Optical Technologies[END_REF]. Optics are believed to have a relative advantage in terms of speed and parallelism compared to electronics. However, the goal of all-optical computers outperforming digital electronic computers has not been realised. Digital electronic computers have progressed much faster than optical computers, making them more powerful, easier to use, and more flexible. Optical computing is mostly analogue, whereas digital electronic computing is digital.

Several researchers have proposed digital optical computers [START_REF] Streibl | [END_REF]. However, digital optics cannot compete with electronics owing to the lack of proper optical components. Therefore, researchers in the field of optical computing have suggested combining optics and electronics and using optics only when it can outperform electronics on a task [START_REF] Ambs | Optical Computing: A 60-Year Adventure Advances in Optical Technologies[END_REF]. Free-space optics and smart-pixels fit this condition and are appropriate for finding new applications of optical computers that compensate for the weakness of electronic processors. Electrical interconnections in computers work well for short distances with a relatively small number of connections between processors. However, they become more complicated and expensive as the number of connections increases [START_REF] Streibl | [END_REF]. In free-space optics, the light paths can cross freely without interfering with each other. This feature of light has significant advantages over electronic circuits, especially as the number of connections increases significantly, such as in the area of artificial neural networks. The arrangement of light paths without worrying about crossing can reduce the complexity of the interconnection and the corresponding cost of fabrication. Moreover, neural networks are analogue and tolerant of input errors to some extent, in principle [START_REF] Rosenblatt | The Perceptron: A Probalistic Model For Information Storage And Organization In The Brain[END_REF]. Being free from adherence to digital optics and competition with digital electronics can provide another opportunity for the development of optical computers, because they are inherently analogue.

Optical neural networks have also been studied by many researchers, although none of them survived commercially in the competition against digital electronic computers [START_REF] Ambs | Optical Computing: A 60-Year Adventure Advances in Optical Technologies[END_REF][START_REF] Mcaulay | Optical Computer Architectures[END_REF]. The defeat of the optical neural network in the competition can be ascribed to its relative complexity and bulkiness compared to the performance gain that was surpassed by its rapidly developing electronic counterpart. In this study, a simple and scalable optical computer was proposed. More design effort will be devoted to the simplicity and scalability of optical computer architecture, taking full advantage of the parallelism of free-space optics and the simultaneous use of electronics such as smart pixels [START_REF] Seitz | Smart Pixels[END_REF]. The simplicity and scalability of the proposed architecture can expand the power of optical parallelism and make optical computers more attractive than digital electronic computers in neural network applications, where many synaptic connections are possible and needed. In this study, the proposed optical computer was demonstrated in hardware based on free-space optics using a lens array and a spatial light modulator (SLM) with distributed electronics, such as smart pixels.

Theory

The understanding of the new optical computer architecture in this study requires an understanding of the neural network. The basic concept of a neural network is illustrated in Fig. 1. The schematic illustrates a neural network consisting of two input nodes and four output nodes with synaptic connections and their mathematical representations. Fig. 1. Example of a simple neural network with mathematical formula. aj (l) represents the j-th input or output node in the lth layer. wji indicates the weight connecting the i-th input node and the j-th output node. bj is the j-th bias and σ is a sigmoid function.

The concept of the optical computer proposed in this study is illustrated in Fig. 2(a). The neural network shown in Fig. 1 was transformed into a hardware schematic including a lightemitting diode (LED), lenses, liquid crystal display (LCD), detector, and electronics, except that the order of the output nodes was reversed. The input node is replaced by an LED, which sends four rays to lens array 1. Lens array 1 collimates the rays and sends them to the LCD, where each pixel transmits the corresponding ray with a preset transmission value called a 'weight' in the neural network. The rays from the LCD pass through lens array 2, which focusses the rays and generates different ray angles depending on the distance of the LCD pixel from the optical axis of the individual lenses in the array. Lens 3 collects the rays from the previous step and sorts them into multiple spots according to the equal inclination rule. Because the image plane of lens 3 coincides with the focal plane of lens 3, rays of equal angle arrive at the same detector. If the distance between the LCD and lens array 2 equals the focal length of lens array 2, the LCD and detector planes are conjugate. Under this conjugate condition, a pixel in the LCD forms an image in the detector plane. This helps define the illumination area of the ray more clearly and reduce the crosstalk between the channels.

A detector collects or adds the optical power of rays of equal angle from different LEDs or inputs with preset weights. The summed light in this scheme is mathematically a linear combination of the inputs with coefficients specified by weights. Therefore, optics carrying out this function can be called a linear combination optical engine (LCOE). This LCOE can perform the calculations in parallel and, most importantly, in one step with the speed of light if the weights and inputs are preset. Although many previous optical computers have demonstrated matrix multiplication with a one-dimensional vector input and output, this LCOE distinguishes itself from the old versions because it is relatively simple and scalable in two dimensions, where the input sources and output detectors are arranged.

The number of LCD pixels belonging to each input node is equal to the number of output nodes to which the input is connected. It can be easily increased to thousands because the pixels are arranged in two dimensions, and the number of pixels available is quite large with the advancement of modern LCD technology. A 32×32 pixel area of the LCD takes charge of one input node and can cover 1024 output nodes. For example, a 1920×1080 resolution LCD can afford 60 ×33 input nodes, amounting to 1980 inputs. Considering the parallelism of the LCOE, its performance is equal to the number of pixels in the LCD. If the system has M inputs and N outputs, it can perform M×N multiplication and (M-1)×N addition in a single step. If LCOE takes full advantage of LCD resolution, M×N equals the total number of pixels in the LCD, which is immense in modern devices. This LCD can be replaced by other types of SLM arrays for high speeds if a fast refresh rate of weights is required.

After the optical process, a detector converts the light into current and electronically carries out the rest of the process, such as amplification of the signal, addition of bias, application of a sigmoid function, and finally production of the input current of the LED in the next layer. This latter part of the process includes inherently nonlinear characteristics for which electronics perform far better and simpler than optics. When using electronics in the latter part, it is recommended that there are not many connections between neighbouring electronics to avoid the traffic cost of electronic interconnections. As long as the electronics used are distributed and local, the optical parallelism of the system will not be harmed. This electronic part, including the detectors, is similar to that of smart pixels [START_REF] Seitz | Smart Pixels[END_REF].

The proposed system can be extended in the direction of beam propagation because it is cascadable. The signal from the output node is directly connected to the corresponding input of the next layer. Therefore, a detector, the corresponding electronics, and LED in the next layer can form a synaptic node in an artificial neural network. An example of a multi-layer optical neural network is shown in Figure 2(b).

If there are L layers in the system, M×N×L calculations can be performed in parallel in one step, which significantly increases the throughput of the optical computer for continuous input flow.

In fact, the addition of incoherent light by a detector and LCD cannot represent a negative weight, which constitutes an inhibitory connection in a neural network. If coherent light and interference effects are used, the system can represent subtraction between inputs. However, employing coherent light may complicate the system and increase the noise. To solve this problem, two optical channels are used for one output to separate the inputs of the positive weights from those of the negative weights, as shown in Fig. 2(c). Each channel adds input values multiplied by weights using optical means. Subsequently, subtraction between them was carried out electronically. Note that the weight in the negative channel is zero when the corresponding positive weight is used and vice versa. This subtraction scheme simplifies the structure at the expense of an additional channel. The use of two channels separately for positive and negative weights is defined as 'difference mode' for future reference while the use of one channel as seen in Fig. 2-(

Experiments

The scalable optical computer proposed in Fig. 2 was implemented in hardware, as shown in Fig. 3. The system comprises key components such as the LCD, lens array 1, lens array 2, lens 3, and detector array. For the lens arrays, planoconvex lenses (EDMUND OPTICS 32471) with a focal length of 12 mm were used, whereas a lens with a focal length of 100 mm was used for lens 3. The LCD panel and its driving board were obtained from an inexpensive mini-LED projector. The detectors used in the hardware were inexpensive Si photodiodes (PDs) with a 3 mm×3 mm detection area. The mechanical holders of the optical components were made using 3D printers with holes near the corners to allow round steel shafts to pass through and form an optical cage system. The entire assembly also includes electronics, such as amplifiers for detectors and current sources for LEDs, as shown in Fig. 3(e). The electronics were controlled by Arduino boards, which were also connected to a laptop. The main program, which runs on a laptop, controls the LCD pattern in the optical computer through the LCD driving board and communicates with two Arduino boards for input and output manipulation.

The number of input and output nodes are both 2×2 in the non-difference mode, whereas the number of effective outputs becomes two in the difference mode. The purpose of this experiment was not to show the full strength of the optical parallelism enabled by this architecture, but to demonstrate its feasibility with minimum complexity in optical and electrical implementation. The LEDs and detectors used in this hardware were discrete devices fixed on 3D printed holders. The number of inputs and outputs can be increased by scaling the system up. However, it requires expensive and compact large array components. As the number of inputs and outputs increases, more attention should be paid to the optomechanical precision of the system for higher signal and less cross-talk between channels.

Although the fabricated optical computer had a single layer of neural network, a multi-layer neural network could be emulated by feeding the outputs of the detector array into the current values in the LED array. This could be easily achieved by running the program on a laptop because this laptop controlled both the input and output values. The extra amplification of the signal, sigmoid function, and subtraction were all implemented using software to avoid the complexity of electronic circuits. However, in principle, these real-time and distributed electronics can be realised in the form of smart pixels for better performance.

Results and discussion

Because the constructed optical computer is analogue, the system needs the output uniformity to be checked. Otherwise, the output corresponding to the value 1.0 of one input channel can differ from that corresponding to the value 1.0 of the other input channel, which leads to an error in the result of the linear combination. For example, the outputs of a unit input in each channel are displayed in Table 1, while the inputs of the other channels are zero, and all the weights are ones. The average value is 0.995, which is 0.5 % less than the intended value with a maximum relative error of 3 %, making it acceptable for the demonstration of this optical computer. In fact, the uniformity of the outputs is affected by various factors, such as device non-uniformity and optomechanical misalignment. These problems were solved by calibrating the devices, using lookup tables, and adjusting the pixel location and pixel shape using software.

Table 1. Uniformity of outputs checked by entering unit inputs. Every element of the weight matrix is one.

Input ( in0 in1 in2 in3 )

Output ( out0 out1 out2 out3 ) 1.000 0.000 0.000 0.000 1.010 0.986 0.998 1.012 0.000 1.000 0.000 0.000 1.012 0.991 0.989 0.988 0.000 0.000 1.000 0.000 1.003 0.989 0.982 0.991 0.000 0.000 0.000 1.000 0.983 0.999 0.998 0.986 The first programs for testing an optical computer are the digital logics NAND and NOR. These logic gates were chosen because they can be easily implemented by a neural network with only two steps, particularly in the non-difference mode. The program steps used for this test are listed in Table 2, with inputs, weights, biases, and corresponding outputs. In the second step, negative amplification of eight times was used to represent the NOT operation, which could be realised as an amplifier circuit in practice, although it was actually performed by the software in this setup. To avoid the use of negative amplification, an extra step is required for the NOT operation, as shown in the last step of Table 2. The first two non-inverted outputs of step 1 were fed into the inputs of step 2, resulting in the two outputs of NAND and NOR, but in the difference mode. The program running on the optical computer had four inputs and four outputs in parallel. The first two outputs are NAND and NOR for the first two inputs, whereas the last two outputs are those for the last two inputs. Table 3 presents the results for various inputs using the same neural network program.

The output values agree with what is expected from the linear combination of the inputs and weights within an error. This small error is not a serious problem because a neural network is usually tolerant of input errors to some extent. The experiment demonstrated that the fabricated hardware functioned well as a neural network in the non-difference mode. In addition, because NAND and NOR are used as basic building blocks for making other logical gates in digital electronics, this experiment also demonstrates the universality of this type of optical computer as digital optics, as well as the feasibility of its analogue computing capability in the form of a neural network. Table 2. NOR and NAND operations of the optical computer in non-difference mode. The inputs and the outputs are displayed in order in the table as input0 shows up first and input3 shows up last. Output0 and output1 give the results of the operation using the input0 and input1. Output2 and output3 give the results of input2 and input3. The last step designated by '*' shows an extra step for NOT operation in difference mode. 0.800 0.000 1.000 1.000 0.000 0.700 1.000 0.000 0.000 1.000

Conclusions

Historically, finding a proper architecture for optical computers has been a difficult problem because while optics has the advantage of linear calculation over electronics, it is inferior in handling nonlinear processes. Therefore, the success of designing an optical computer relies on how to associate optics and electronics by separating the linear part of the process from the nonlinear part and properly allocating optics and electronics. This strategy can be applied to neural networks because heavy calculations and complicated wiring are necessary for a large number of synaptic connections. Free-space optics can provide more connectivity with efficiency and ease compared to electronics, especially as the number of connections between the input and output nodes increases.

In this study, a scalable optical computer based on freespace optics is proposed. The two lens arrays in combination with an SLM and a large-diameter lens split the weighted inputs into multiple detectors, which also adds light from multiple inputs at the speed of light. This optical setup, called the LCOE, can perform a large number of calculations in parallel. The remaining parts of the neural network, such as adding bias and applying a sigmoid function, can be performed by distributed and local electronics, such as smart pixels. The strength of this LCOE is its scalability for twodimensional arrays of LEDs, detectors, and SLM pixels. The total number of calculations that can be performed in parallel is equal to the number of pixels in the SLM. The proposed architecture can provide massive optical parallelism owing to the recent advances in display panel technology.

In addition, a difference mode was suggested to handle negative weights. Two optical channels were used to collect the inputs with positive and negative weights separately. Subtraction between them was performed using electronics. This type of scheme can simplify the system at the expense of an additional channel.

The proposed optical computer was constructed by assembling lenses, LEDs, PDs, and an LCD panel to demonstrate its feasibility. All the components were fixed in 3D printed holders with 2×2 inputs and 2×2 outputs. The optical setup assembled in a cage system formed an optical computer with subsidiary electronics, such as current sources, amplifiers, Arduinos, and a laptop to control inputs and outputs. This hardware can emulate a multi-layer neural network by feeding the outputs into the inputs through a program running on a laptop.

To test the optical computer, NAND and NOR logics were programmed in the constructed optical computer by configuring the weights and biases in two steps in nondifference mode. The outputs for various inputs agreed with what was expected from the design. The test program demonstrated the parallel performance and feasibility of the optical computer. It also demonstrated the universality of this optical computer as a digital computer.

Finally, a simple pattern-checking program was implemented using the optical computer. The program gave two outputs successfully in difference mode to determine whether the 2 × 2 input pattern was close to 'giyeok' or 'gamma'. This test program demonstrated that the difference mode of the optical computer works well, as expected from the architecture.

In summary, a scalable optical computer based on freespace optics using lens arrays and an SLM was proposed, and its hardware was realised to demonstrate its feasibility.

Although the constructed optical computer has only 2 × 2 inputs and 2×2 outputs, in principle, it can be scaled up into large two-dimensional arrays of inputs and outputs as well as multiple layers. This type of optical computer can provide massive optical parallelism if the system uses large array components with high-speed distributed electronics and precise optomechanics.

Fig. 2 .

 2 Fig. 2. Schematics of optical computer based on free-space optics using lens arrays and spatial light modulator: (a) Nondifference mode optical neural network; (b) cascadable multi-layer optical neural network; (c) difference mode optical neural network.

3 .Fig. 4 .

 34 Parts used in the fabricated optical computer and the final assembly with electronics: (a) LCD panel and its driver board; (b) 2×2 lens array; (c) lens 3 with a focal length of 100 mm; (d) 2×2 detector array; (e) optical computer assembly under operation with subsidiary electronics and a laptop. The optical setup of the system was checked step-by-step during assembly. The green spots generated by the lens array and LCD are shown in Fig. 4(a), (b), and (c), in the order of distance from lens 3. Fig. 4(a) shows the spot pattern closest to lens 3, Fig. 4(b) in the middle of lens 3 and the detector, and Fig. 4(c) shows the spots near the detector plane. The first picture shows 16 spots, where four spots from each input. The second image shows that the four spots from each input move away from their own centre and start overlapping with those of the neighbouring inputs. The last one shows that the 16 spots collapsed into four spots aligned with the four detectors. This change in the spot shape also shows that the optics work as expected from the design. Fig. 4(d) shows a typical scene of an optical computer under operation with a cloth covering the optical system for blocking external light and a laptop screen displaying the LCD pattern during the operation. Spot images generated by LCOE at various distances from lens 3 and the LCD patterns displayed on the notebook: (a) close to lens 3; (b) in the middle of lens 3 and the detector; (c) close to the detector array; (d) patterns generated by a laptop, which are transferred to the LCD panel in the optical computer.

Program

Step Count Input Weight ( out0 out1 out2 out3 )

Bias

Output Sigmoid after Amplification (X8) X(-8) 0 0.150 1.000 0.000 0.000 0.000 -0.5 -0.342 0.061 0.850 0.000 1.000 0.000 0.000 -0.5 0.334 0.935 0.150 0.000 0.000 1.000 0.000 -0.5 -0.332 0.065 0.150 0.000 0.000 0.000 1.000 -0. The second program for testing the optical computer is a simple example of pattern checking that was performed in one step in the difference mode. Because the fabricated hardware has only 2×2 inputs, there are few patterns to distinguish. The LEDs were arranged in a 2×2 matrix in the hardware. The first and third inputs form the first column, whereas the second and fourth inputs form the second column. From this point of view, the first input pattern in Table 4 looks like a 'giyeok', which is the first Korean letter while the second input resembles a Greek 'gamma'. After applying the sigmoid function, the first and second outputs confirm the giyeok and gamma, respectively. The program was easy to understand because the desired input was appointed as a positive weight for excitatory connections and the unwanted input was appointed as a negative weight for inhibitory connections. As for the last input in Table 4, the outputs confirmed neither character as expected. This example also shows that the fabricated optical computer works well in the difference mode. Table 4. Simple pattern checking operation of the optical computer in the difference mode. The inputs can be interpreted as a two-dimensional pattern as input0 and input1 form the first row in 2×2 matrix and input2 and input3 form the second row. Output0 and output1 confirm the pattern 'giyeok' and the pattern 'gamma', respectively.