A Web Tool for Research in Nonlinear Optics

. This paper presents a project of developing the web platform called WebNLO for computer modeling of nonlinear optics phenomena. We discuss a general scheme of the platform and a model for interaction between the platform modules. The platform is built as a set of interacting RESTful web services (SaaS approach). Users can interact with the platform through a web browser or command line interface. Such a resource has no analogues in the ﬁeld of nonlinear optics and will be created for the ﬁrst time therefore allowing researchers to access high-performance computing resources that will signiﬁcantly reduce the cost of the research and development process.


Introduction
Successful development of optical devices requires complicated modeling of physical processes that occur in components of the devices and comprehensive database for optical properties of used materials. In many cases researchers need to run a large number of similar computing tasks to solve some problem in the field of nonlinear optics (NLO). Quite often, these tasks are performed by using already existing specialized application packages, the tasks being identical in form and differing only in the values of the input data (parameters). In this case, pre-installation and configuration of commonly used application packages on a computing resource and the availability of specialized web services as well as appropriate user web interfaces (SaaS model) allow researchers to increase efficiency of use of computing resources. The set of specialized web services and web application interfaces is called web platform for remote access to computing resources. Each individual pre-arranged task (a launch of an application package, an access to a data storage, and so on) is called "a tool". With the access to the tools provided by a platform, a user only has to specify particular values of the input parameters or input files, and the rest of the task description is generated automatically. Thus the user can carry out the generating of the task, its submission, monitoring, and getting the results via a standard web browser.
This approach proves to be particularly effective and convenient when the full research requires a set of application packages rather than just one of them. Moreover, often the output of some package is the basis for the generating of the task for the next application package in a series of stages of the research. Such series of tasks are called workflows. Besides the launch of computing packages, workflow may include other operations such as a query to relational database, visualization of the results or obtaining online data from an operating scientific facility. Carrying out of these operations can be made as simple as possible for end users by pre-configuring all the technical details (such as the Internet address of the resources, the specific formats of the query to a particular database or facility); in other words, creating a complete "tool". The user then only needs to formulate the essence of a specific request in a natural language (more details on the use of the web platforms in scientific research see, e.g. in [1]).
At present, there are many sources containing various mathematical models and large amount of data on the properties of nonlinear optical crystals in the form of a software [2], [3], [4]. Currently, however, there are no a single web based tool (web platform) which allows access to data and computational resources required for research and engineering tasks in nonlinear optics.
We present an on-line environment, namely the web platform WebNLO, intended for supporting research in nonlinear optics. The platform provides users with an access to a database for optical properties of crystal materials and to computational modules installed on remote resources which implement algorithms required for development of scientific models and devices in nonlinear optics.

WebNLO general scheme and design principles
The general scheme of the proposed web platform and interactions of its modules with each other are depicted in figure 1. Since the visible to user frontend to SaaS application cannot directly access internal systems such as databases and computation modules, the components of a SaaS application enable integration protocols and application programming interfaces (APIs) that operate over a wide area network. Typically these are protocols based on HTTP, SOAP, XML-RPC, REST. But the modern implementations are most commonly based on the REST architectural style combined with JavaScript Object Notation (JSON) as a message format. In most cases REST/JSON combination provides flexible protocol for message passing which is lightweight in terms of memory and processing power.
In this model everything is presented as a resource. All operations with these resources are strictly restricted and standardized. An essential advantage of RESTful-services is that the HTTP protocol is used directly as the message exchange protocol while in the other approaches HTTP is used only as a transport protocol for the SOAP serving as the messages exchange protocol. Moreover the REST/JSON has native support in all the modern web browsers (which usually serves as a client to SaaS applications). These properties make the use of the REST architectural style is very attractive for the development of web platforms. Further details and advantages of the REST architectural style can be found in [5], [6].
Since REST/JSON message passing scheme is quite simple, there are many popular frameworks which can be use for the platform construction, in particular, Django, Pyramid, Zope, Flask, etc. However since some services wrap an access to a database into REST/JSON, such a microframework like Flask should be used to implement REST interface for platform services. The microframework has minimal functionality, but it is sufficient for the operation of the WebNLO platform.
Considering that the main objective of the WebNLO project is to provide access to data and computational resources for researchers in nonlinear optics, we can identify the following required web platform modules (see figure 1): • user management, authentication and authorization module; • module of access to the NLO database; • task management module; • job execution module;  Since WebNLO has to interact with HPC, grid and cloud services, it is important to separate the stages of preparation and execution of computational tasks. Therefore WebNLO separates functionality of the task management module and the job management module: • task management module stores and selects local copies of computational modules for calculation of NLO processes. prepares input data for jobs by means of the NLO database; prepares jobs for job management module, for example, prepares parametric jobs for a parameter search; • job management module executs jobs provided by task management module on local servers, HPC, grid and cloud systems; manages started jobs that includes monitoring, job termination, etc. An essential part of the platform is the NLO database which contains three main parts: bibliography, crystal parameters and experimental data. The number of relevant bibliographic entries is currently estimated as 10000-15000. The crystal parameters is separated into two categories: general parameters (e.g., name, symmetry and point group, etc.) and optical parameters (e.g., transparency range, refraction indices, etc.). These data are highly structured with very structured access from other modules, therefore an implementation on the top of the generic SQL server such as MySQL or PostgreSQL is preferable.
The module of user management as well as of authentication and authorization provides secure access of users to the web platform resources with the appropriate rights. The visualization module allows to present results of the computing jobs in a graphical form.
Since task management and job management modules essentially provide only management function they do not have special implementation requirements to software stack. Similarly, since the input and output data in the field of nonlinear optics does not typically exceed the scale of megabytes there are no special requirements to the performance of data exchange protocols.
At first stage of the project, the computational modules for simulation of NLO processes include the following calculations: (i) calculation of the phase matching for the second harmonic generation [7,8] that allows to study the second harmonic generation in crystals with a regular domain structure [9] by means of He-Ne laser with wavelength of 3.39 µm. (ii) calculation of sum and difference frequency generation parameters [10] including the calculation of a phase-matching angle dependence on the azimuthal angle, tuning characteristics of pump wavelengths, crystal optical axis orientation and on the temperature of NLO crystals; (iii) modeling the NLO processes in a supercontinuum generation by using microstructured optical fibers [11] and ultrashort-pulsed lasers [12].
All the modules receive information about the properties of optical crystals from the NLO database. Thus the typical research (workflow) in the WebNLO environment comprises of the following steps • submitting query to the database and obtaining its result; • creation of the input files for a computational job on the basis of the preceding step; • launching the computational job and obtaining its result; • visualization of the result.
Another example of typical workflows is a parametric search when the same computational job is repeatedly launched with different values of some input parameters for an optimization of properties of an optical device.

Conclusion
Currently the development of scientific web applications is booming around the world. In particular, development of web platforms for scientific research in different areas are widely underway around the world. Examples of such developments are nanoHUB (http://www.nanohub.org) for researches in nanotechnology and Yabi (https://ccg.murdoch.edu.au/yabi) for researches in the area of bioinformatics (other examples and discussions see in [1]). Though all the developments are based on the basic principles of service oriented architecture (SOA), their implementations are adapted to the specific application area or functional purpose (e.g., nanoHUB is intended mainly for educational purposes).
In this paper we presented the design of a web platform, entitled WebNLO, for computer modeling of nonlinear optics phenomena.The platform provides users with an access to database of optical properties of crystal materials and with a capability to execute computational tasks in the field of nonlinear optics. It includes computational modules which implement computational algorithms required for development of scientific models and devices in nonlinear optics. The platform uses the SaaS model and is built as a set of interacting RESTful web services. Users interact with the platform by means of a web browser or the command line interface. We have discussed the general scheme of WebNLO and the model of interactions between the platform modules. Such a resource which currently has no analogues will allow researchers to access high-performance computing resources that will significantly reduce the cost of the research and development process.