* Markum and Toyama (2020) Robert B. Markum and Kentaro Toyama. 2020.  _Digital Technology, Meditative and Contemplative Practices, and Transcendent Experiences_.  Association for Computing Machinery, New York, NY, USA, 1–14.  https://doi.org/10.1145/3313831.3376356
  * Maslow (1943) Abraham H Maslow. 1943.  A theory of human needs.  _Psychological Review_ 50 (1943), 370–396.
  * Mauriello et al. (2014) Matthew Mauriello, Michael Gubbels, and Jon E Froehlich. 2014.  Social fabric fitness: the design and evaluation of wearable E-textile displays to support group running. In _Proceedings of the SIGCHI Conference on Human Factors in Computing Systems_ (Toronto, Ontario, Canada) _(CHI ’14)_. Association for Computing Machinery, New York, NY, USA, 2833–2842.  https://doi.org/10.1145/2556288.2557299
  * Niksirat et al. (2019) Kavous Salehzadeh Niksirat, Chaklam Silpasuwanchai, Peng Cheng, and Xiangshi Ren. 2019.  Attention Regulation Framework: Designing Self-Regulated Mindfulness Technologies.  _ACM Trans. Comput.-Hum. Interact._ 26, 6 (Nov. 2019), 1–44.  https://doi.org/10.1145/3359593
  * Núñez-Pacheco and Frid (2023) Claudia Núñez-Pacheco and Emma Frid. 2023.  Sharing Earthquake Narratives: Making Space for Others in our Autobiographical Design Process. In _Proceedings of the 2023 CHI Conference on Human Factors in Computing Systems_ (Hamburg, Germany) _(CHI ’23, Article 685)_. Association for Computing Machinery, New York, NY, USA, 1–18.  https://doi.org/10.1145/3544548.3580977
  * O’Kane et al. (2014) Aisling Ann O’Kane, Yvonne Rogers, and Ann E Blandford. 2014.  Gaining empathy for non-routine mobile device use through autoethnography. In _Proceedings of the SIGCHI Conference on Human Factors in Computing Systems_ (Toronto, Ontario, Canada) _(CHI ’14)_. Association for Computing Machinery, New York, NY, USA, 987–990.  https://doi.org/10.1145/2556288.2557179
  * Pirzadeh et al. (2013) Afarin Pirzadeh, Li He, and Erik Stolterman. 2013.  Personal informatics and reflection: a critical examination of the nature of reflection. In _CHI ’13 Extended Abstracts on Human Factors in Computing Systems_ (Paris, France) _(CHI EA ’13)_. Association for Computing Machinery, New York, NY, USA, 1979–1988.  https://doi.org/10.1145/2468356.2468715
  * Poulos ([n. d.]) Christopher N Poulos. [n. d.].  _Essentials of Autoethnography_.  American Psychological Association.  https://www.apa.org/pubs/books/essentials-of-autoethnography
  * Prpa et al. (2018) Mirjana Prpa, Kıvanç Tatar, Jules Françoise, Bernhard Riecke, Thecla Schiphorst, and Philippe Pasquier. 2018.  Attending to Breath: Exploring How the Cues in a Virtual Environment Guide the Attention to Breath and Shape the Quality of Experience to Support Mindfulness. In _Proceedings of the 2018 Designing Interactive Systems Conference_ (Hong Kong, China) _(DIS ’18)_. Association for Computing Machinery, New York, NY, USA, 71–84.  https://doi.org/10.1145/3196709.3196765
  * Rapp (2021) Amon Rapp. 2021.  In Search for Design Elements: A New Perspective for Employing Ethnography in Human-Computer Interaction Design Research.  _International Journal of Human–Computer Interaction_ 37, 8 (May 2021), 783–802.  https://doi.org/10.1080/10447318.2020.1843296
  * Ray (2020) Joe Ray. 2020.  Zoom Serves Up New Friends in a Roman Kitchen.  _Wired_ (20 Dec. 2020).
  * Rode (2011) Jennifer A Rode. 2011.  Reflexivity in digital anthropology. In _Proceedings of the SIGCHI Conference on Human Factors in Computing Systems_ (Vancouver, BC, Canada) _(CHI ’11)_. Association for Computing Machinery, New York, NY, USA, 123–132.  https://doi.org/10.1145/1978942.1978961
  * Roo et al. (2017) Joan Sol Roo, Renaud Gervais, Jeremy Frey, and Martin Hachet. 2017.  Inner Garden: Connecting Inner States to a Mixed Reality Sandbox for Mindfulness. In _Proceedings of the 2017 CHI Conference on Human Factors in Computing Systems_ (Denver, Colorado, USA) _(CHI ’17)_. Association for Computing Machinery, New York, NY, USA, 1459–1470.  https://doi.org/10.1145/3025453.3025743
  * Saldaña (2021) Johnny Saldaña. 2021.  _The coding manual for qualitative researchers_.  sage.
  * Sas and Chopra (2015) Corina Sas and Rohit Chopra. 2015.  MeditAid: a wearable adaptive neurofeedback-based system for training mindfulness state.  _Pers. Ubiquit. Comput._ 19, 7 (Oct. 2015), 1169–1182.  https://doi.org/10.1007/s00779-015-0870-z
  * Seering et al. (2017) Joseph Seering, Robert Kraut, and Laura Dabbish. 2017.  Shaping Pro and Anti-Social Behavior on Twitch Through Moderation and Example-Setting. In _Proceedings of the 2017 ACM Conference on Computer Supported Cooperative Work and Social Computing - CSCW ’17_. ACM Press, New York, New York, USA, 111–125.  https://doi.org/10.1145/2998181.2998277
  * Segal et al. (2018) Zindel Segal, Mark Williams, and John Teasdale. 2018.  _Mindfulness-Based Cognitive Therapy for Depression, Second Edition_.  Guilford Publications.
  * Sheng and Kairam (2020) Jeff T Sheng and Sanjay R Kairam. 2020.  From Virtual Strangers to IRL Friends: Relationship Development in Livestreaming Communities on Twitch.  _Proceedings of the ACM on Human-Computer Interaction_ 4, CSCW2 (14 Oct. 2020), 1–34.  https://doi.org/10.1145/3415165
  * Skinner (1965) Burrhus Frederic Skinner. 1965.  _Science and human behavior_.  Number 92904. Simon and Schuster.
  * Smyth et al. (2018) Joshua M Smyth, Jillian A Johnson, Brandon J Auer, Erik Lehman, Giampaolo Talamo, and Christopher N Sciamanna. 2018.  Online Positive Affect Journaling in the Improvement of Mental Distress and Well-Being in General Medical Patients With Elevated Anxiety Symptoms: A Preliminary Randomized Controlled Trial.  _JMIR Ment Health_ 5, 4 (Dec. 2018), e11290.  https://doi.org/10.2196/11290
  * Taber et al. (2020) Lee Taber, Leya Breanna Baltaxe-Admony, and Kevin Weatherwax. 2020.  What makes a live stream companion? Animation, beats, and parasocial relationships.  _Interactions_ 27, 1 (1 Jan. 2020), 52–57.  https://doi.org/10.1145/3372042
  * Tan et al. (2023) Felicia Fang-Yi Tan, Ashwin Ram, Chloe Haigh, and Shengdong Zhao. 2023.  Mindful Moments: Exploring On-the-go Mindfulness Practice On Smart-glasses. In _Proceedings of the 2023 ACM Designing Interactive Systems Conference_ (Pittsburgh, PA, USA) _(DIS ’23)_. Association for Computing Machinery, New York, NY, USA, 476–492.  https://doi.org/10.1145/3563657.3596030
  * Terzimehić et al. (2019) Nađa Terzimehić, Renate Häuslschmid, Heinrich Hussmann, and m.c. schraefel. 2019.  A review & analysis of mindfulness research in HCI: Framing current lines of research and future opportunities. In _Proceedings of the 2019 CHI Conference on Human Factors in Computing Systems_. Association for Computing Machinery, New York, NY, USA, 1–13.  https://doi.org/10.1145/3290605.3300687
  * Thayer et al. (2012) Alexander Thayer, Matthew J. Bietz, Katie Derthick, and Charlotte P. Lee. 2012.  I Love You, Let’s Share Calendars: Calendar Sharing as Relationship Work. In _Proceedings of the ACM 2012 Conference on Computer Supported Cooperative Work_ (Seattle, Washington, USA) _(CSCW ’12)_. Association for Computing Machinery, New York, NY, USA, 749–758.  https://doi.org/10.1145/2145204.2145317
  * The New York Times (2021) The New York Times. 2021.  See Reopening Plans and Mask Mandates for All 50 States.  _The New York Times_ (1 July 2021).
  * Thomas (2020) Mark Daman Thomas. 2020.  Digital performances Live-streaming music and the documentation of the creative process.  _The future of live music_ (2020), 83–96.
  * Umberson and Montez (2010) Debra Umberson and Jennifer Karas Montez. 2010.  Social relationships and health: a flashpoint for health policy.  _Journal of health and social behavior_ 51 Suppl, Suppl (2010), S54–66.  https://doi.org/10.1177/0022146510383501
  * van Aalderen et al. (2014) Joël R van Aalderen, Walter J Breukers, Rob P B Reuzel, and Anne E M Speckens. 2014.  The Role of the Teacher in Mindfulness-Based Approaches: A Qualitative Study.  _Mindfulness_ 5, 2 (April 2014), 170–178.
  * Vieten et al. (2018) Cassandra Vieten, Helané Wahbeh, B Rael Cahn, Katherine MacLean, Mica Estrada, Paul Mills, Michael Murphy, Shauna Shapiro, Dean Radin, Zoran Josipovic, David E Presti, Michael Sapiro, Jan Chozen Bays, Peter Russell, David Vago, Fred Travis, Roger Walsh, and Arnaud Delorme. 2018.  Future directions in meditation research: Recommendations for expanding the field of contemplative science.  _PLoS One_ 13, 11 (Nov. 2018), e0205740.  https://doi.org/10.1371/journal.pone.0205740
  * Wahbeh et al. (2014) Helané Wahbeh, Matthew N Svalina, and Barry S Oken. 2014.  Group, One-on-One, or Internet? Preferences for Mindfulness Meditation Delivery Format and their Predictors.  _Open Med._ 1 (Nov. 2014), 66–74.  https://doi.org/10.2174/1874220301401010066
  * Wall (2006) Sarah Wall. 2006.  An Autoethnography on Learning About Autoethnography.  _International Journal of Qualitative Methods_ 5, 2 (June 2006), 146–160.  https://doi.org/10.1177/160940690600500205
  * Wang et al. (2019) Dennis Wang, Yi-Chieh Lee, and Wai-Tat Fu. 2019.  “I Love the Feeling of Being on Stage, but I Become Greedy”: Exploring the Impact of Monetary Incentives on Live Streamers’ Social Interactions and Streaming Content.  _Proc. ACM Hum.-Comput. Interact._ 3, CSCW (7 Nov. 2019), 1–24.  https://doi.org/10.1145/3359194
  * Wohn (2019) Donghee Yvette Wohn. 2019.  Volunteer moderators in twitch micro communities: How they get involved, the roles they play, and the emotional labor they experience. In _Proceedings of the 2019 CHI Conference on Human Factors in Computing Systems (CHI’19)_. Association for Computing Machinery, New York, NY, USA, 1–13.  https://doi.org/10.1145/3290605.3300390
  * Wu et al. (2020) Jiachuan Wu, Robin Muccari, Anna Sundberg, and Brianna DeJesus-Banos. 2020.  Reopening America: All 50 states have begun to reopen. See what that means for your state.  _NBC News_ (11 June 2020).
  * Wu et al. (2024) Shaomei Wu, Jingjin Li, and Gilly Leshed. 2024.  Finding My Voice over Zoom: An Autoethnography of Videoconferencing Experience for a Person Who Stutters. In _Proceedings of the 2024 CHI Conference on Human Factors in Computing Systems_ (Honolulu, HI, USA) _(CHI ’24)_. Association for Computing Machinery, New York, NY, USA.  https://doi.org/10.1145/3613904.3642746


# Three Quantum Programming Language Parser Implementations for the Web

Marcus Edwards Electrical and Computer Engineering, University of British
Columbia, Vancouver, BC, CA  Marcus Edwards

###### Abstract

IBM has developed a quantum assembly (QASM) language particular to gate model
quantum computing since 2017 [4]. Version 3.0 which adds timing, pulse
control, and gate modifiers is currently undergoing finalization in 2023 [5].
In a similar vein, Pakin of Los Alamos National Laboratory published a quantum
macro assembler (QMASM) for D-Wave quantum annealers in 2016 [11]. This
assembler specifically targets quantum annealers like D-Wave’s. A comparable
technology that targets continuous-variable (CV) quantum computing is the
Blackbird language developed by Xanadu since 2018 [8]. We implement parsers
for each of these languages in TypeScript with a singular approach. In the
cases of Blackbird and QMASM these are the first parser implementations that
are web compatible and so bring these languages to a new audience and to new
runtimes. This makes the parsing and execution of QMASM, QASM and Blackbird
possible in web and mobile environments that don’t have access to heavy
compile toolchains, enabling adoption and scientific research.

##  1 Background

###  1.1 Gate Model Quantum Computing

We can arrive at the specific computational basis vectors typically used for
quantum computing in the gate model by considering the Pauli spin operators
$\hat{S}$ of a spin-$\frac{1}{2}$ particle such as an electron.

$\displaystyle S_{x}=\frac{\hbar}{2}\begin{bmatrix}0&1\\\ 1&0\end{bmatrix}\;$
$\displaystyle S_{z}=\frac{\hbar}{2}\begin{bmatrix}1&0\\\ 0&-1\end{bmatrix}$

$S_{y}=-iS_{x}S_{z}$

We take our computational basis vectors
$\ket{l,m_{s}}\in\\{\ket{0},\ket{1}\\}$ to be defined by the eigenvalue
equation $S_{z}\ket{l,m_{s}}=\pm\frac{\hbar}{2}\ket{l,m_{s}}$.

$\displaystyle\ket{1}=\begin{bmatrix}0\\\ 1\end{bmatrix}\;\;$
$\displaystyle\;\;\ket{0}=\begin{bmatrix}1\\\ 0\end{bmatrix}$

Together with matrix multiplication, a few other matrices and the CNOT gate,
the Pauli matrices form the Clifford algebra. The Clifford algebra plus the
so-called $T$ gate is the mathematical backdrop of quantum computing in most
cases, though there are alternative universal gatesets [10, 2].

In terms of the basis vectors $\\{\ket{0},\ket{1}\\}$ we can write a quantum
(qubit) state as $\ket{\psi}$.
$\ket{\psi}=\alpha\ket{0}+\beta\ket{1}\;;\alpha,\beta\in\mathsf{C}$.

Since $\alpha$ and $\beta$ are complex they are normalized by taking their
squares. Physically, the squares of these coefficients are the probabilities
of observing either basis state via the a measurement in the appropriate
basis. $p(\psi=0)=|\alpha|^{2}$, $p(\psi=1)=|\beta|^{2}$,
$|\alpha|^{2}+|\beta|^{2}=1$,

$\displaystyle M_{0}=\begin{bmatrix}1&0\\\ 0&0\end{bmatrix}\;\;\;$
$\displaystyle\;\;\;M_{1}=\begin{bmatrix}0&0\\\ 0&1\end{bmatrix}$

It is a simple process to normalize a quantum state. The normalization
requirement restricts our state vector to a sphere called the Bloch sphere.
This makes it natural to express the state in polar coordinates.
$\ket{\psi_{norm}}=1/\sqrt{|\alpha|^{2}+|\beta|^{2}}\ket{\psi}$,
$|\alpha|^{2}=cos^{2}(\frac{\theta}{2})$,
$|\beta|^{2}=sin^{2}(\frac{\theta}{2})$,
$\ket{\psi}=cos(\frac{\theta}{2})\ket{0}+sin(\frac{\theta}{2})e^{i\phi}\ket{1}$.

The set of matrices that take a state on the Bloch sphere to another state on
the Bloch sphere are the same that rotate a vector on a unit sphere. These are
the unitary transformations $U$ with the following form and properties. $U$
rotates a state vector by $\gamma$ about $(n_{x},n_{y},n_{z})$.
$U^{\dagger}U=I$, $U^{\dagger}=(U^{*})^{T}$,
$U=e^{i\delta}[cos(\frac{\gamma}{2})I+isin(\frac{\gamma}{2})(n_{x}S_{x}+n_{y}S_{y}+n_{z}S_{z})]$.

###  1.2 Continuous Variable Quantum Computing

The continuous-variable model of quantum information deals with operators that
have continuous spectra. Some fundamental operators in quantum physics are not
efficient to capture using discrete simulations, like position and momentum.
Continuous-variable quantum computing is a unique and valuable computing
paradigm since it can simulate physical systems that deal with similarly
continuous quantum operators. Rather than dealing in unitary operations,
continuous-variable computing constructs a quantum circuit model using
continuous gates including quadrature operators, mode operators, state
rotations, displacements, squeezing, etc. Rather than a unit of quantum
information being represented by a qubit, the basic computational element is a
qumode. A qumode has a simple mathematical representation: $\ket{\psi}=\int
dx\;\psi(x)\;\ket{x}$.

Like with a qubit, $\ket{x}$ are eigenstates. In the place of the qubit’s
discrete coefficients, a qumode has a continuum. A state of quantum
information in the CV paradigm is a Gaussian state of the following form,
where H is a Bosonic Hamiltonian describing the state in relation to the
vacuum state $\ket{0}$. $\ket{\psi}=e^{-itH}\ket{0}$.

Like in the qubit system, a CV gate operates on a state. There is a universal
set of CV gates as well, which includes the following operators.

Displacement | $D_{i}(\alpha)=e^{\alpha\hat{a}_{i}^{\dagger}-\alpha^{*}\hat{a}_{i}}$
---|---
Rotation | $R_{i}(\phi)=e^{i\phi\hat{n}_{i}}$
Squeezing | $S_{i}(z)=e^{\frac{1}{2}(z^{*}\hat{a}_{i}^{2}-z\hat{a}_{i}^{\dagger 2})}$
Beam Splitter | $BS_{ij}(\theta,\phi)=e^{\theta(e^{i\phi}\hat{a}_{i}^{\dagger}\hat{a}_{j}-e^{i\phi}\hat{a}_{i}\hat{a}_{j}^{\dagger})}$
Cubic Phase | $V_{i}(\gamma)=e^{i_{\frac{\gamma}{6}}]\hat{x}_{i}^{3}}$

Unlike qubits in gate model quantum computers, CV states can be measured in
different ways. The first type of measurement, a “homodyne measurement”, is
similar to the measuring operator of the qubit and projects a state onto
eigenstates. These eigenstates are the eigenstates of the quadrature operator
$\hat{x}$: $\hat{x}=\sqrt{\frac{\hbar}{2}}(\hat{a}+\hat{a}^{\dagger})$.

Another type of measurement, a “heterodyne measurement”, is an uncertain
measurement of two operators that do not commute which will yield some
probabilistic result for each.

A final type of measurement is a “photon counting” measurement, which yields
the number of photons in a given qumode. This measure projects a state onto
the number states.
$|\alpha>=e^{-\frac{|\alpha|^{2}}{2}}\sum_{n=0}^{\infty}\frac{\alpha^{n}}{\sqrt{n!}}|n>$.

###  1.3 Quantum Annealing

Quantum annealing is a physical method of minimizing a given function that
exploits quantum tunneling to find probable min-terms. D-Wave’s annealers are
capable of solving problems of a particular form.

$\mathbf{H}(\hat{\sigma})=\sum_{i=0}^{N-1}h_{i}\sigma_{i}+\sum_{i=0}^{N-2}\sum_{j=i+1}^{N-1}J_{i,j}\sigma_{i}\sigma_{j}$

This equation expresses a Hamiltonian in terms of linear coefficients $h_{i}$
and quadratic coefficients $J_{i,j}$. In reality, each $\sigma_{i}$ is a
physical qubit, while $h_{i}$ is specified by the application of an external
field and $J_{i,j}$ are inter-qubit coupling strengths.

To perform a minimization of a given problem, an annealer first initializes
each qubit to a superposition of 0 and 1 by means of a strong transverse
field. The coefficients are configured to specify the parameters of the
specific problem to be solved. Then, the transverse filed is lessened over
time, to allow each qubit to relax to a stationary state.

The amount of time required for this process is not universally more efficient
than a classical annealer solving the same problem. However, it has been
proven that a quantum hardware annealer is certainly more efficient than
classical analogues in a few cases. The annealing time used by a D-Wave
machine can be between 1 $\mu$s and 2000 $\mu$s and can be configured by the
user. An important limitation of a D-Wave annealer is that the physical
topology of the qubit network is a two-dimensional mesh of 8 qubit bipartile
graphs [3]. This means that not every qubit may be coupled to every other.

Quadratic pseudo-Boolean functions (QUBOs) of the form in the equation above
can be designed such that they are minimized when provided an intended set of
relations of inputs and outputs.

##  2 Implementations

The packages share a similar layout. Each provides a user with two interfaces:
one for parsing files and one for parsing code strings directly. One might
make use of the packages together to parse code targeted at different backends
in a single script by including these imports.

⬇

import * as qasm from ’qasm-ts’;

import * as blackbird from ’blackbird-ts’;

import * as qmasm from ’qmasm-ts’;

Each package internally implements a lexer and token parser. However, the user
simply calls either the parse() or parseString() method to invoke the entire
parsing process which includes the steps:

  * •

lexing - scanning the provided code (in some cases with a lookahead) and
converting it into a list of tokens

  * •

parsing - walking the token list and creating an abstract syntax tree
representation of the code

The tokens are implemented as elements of a TypeScript enum enumeration.

⬇

enum Token {

Plus,

Minus,

Times,

Divide,

…

}

These tokens are matched to elements of the provided code via a lookup map.

⬇

const lookupMap: object = {

’,’: Token.Comma,

’:’: Token.Colon,

’”’: Token.Quote,

’(’: Token.Lbrac,

…

}

The parser makes use of a class AstNode to build the abstract syntax tree.
AstNode is a parent class for all valid AST elements. For example, the Array
class in blackbird-ts is an extension of a Parameter class which extends the
AstNode class. Once the parser finishes building the AST, it returns a list of
nested AstNodes to the user.

The lex() method of the lexer reads the input file one character at a time and
attempts to match string literals to the file contents. In many cases, such as
with the string literal for exponentiation in Blackbird (**), a lookahead is
required to match the multi-character symbol. The lexer maps symbols in the
input file to Tokens.

The parse() method of each package calls a parseNode() method which delegates
the parsing of the next Token to an appropriate method on the Parser class.
These vary in complexity from parseExpression() which parses a logical or
mathematical expression to bool() which parses a boolean variable declaration
/ initialization. Below we include the pseudocode for parseExpression.

⬇

/**

* Parses a logical and mathematical expression.

* @param tokens - Expression tokens to parse.

* @return A parsed expression.

*/

parseExpression(tokens: Array<Token>): Expression

elements = []

while (tokens.length > 0)

if (notNestedParam(tokens[0]))

node = parseNode(tokens)

if (node != undefined)

for (let i in node)

elements.push(node[i])

tokens = tokens.slice(1)

else

node = parseNode(tokens)

if (node != undefined)

for (let i in node)

elements.push(node[i])

while (!matchNext(tokens, Token.Rbrac) && tokens.length > 0)

tokens = tokens.slice(1)

tokens = tokens.slice(1)

return new Expression(elements)

The parseNode() method maps Tokens to objects. These objects include all of
the supported gates. The following operators are supported by the blackbird-ts
package: Xgate, Zgate, Dgate, Sgate, Rgate, Pgate, Vgate, Kgate, Fouriergate,
CXgate, CZgate, CKgate, BSgat, S2gate, Interferometer, GaussianTransform,
Gaussian. These state preparations are also supported: Fock, Coherent,
Squeezed, Vac, Thermal, DisplacedSqueezed, Catstate.

A similar set of gates is supported by the qasm-ts package: x, y, z, u1, u2,
u3, s, sdg, h, tdg, cx, cy, cz, t, ccx, reset, cu1, ccy, ccz. Qasm-ts also
supports custom gates since version 1.1.0.

Qmasm-ts supports the following features of QMASM.

  * •

Specifying 2-local Ising Hamiltonian parameters via: qubit weights, coupling
strengths

  * •

Relating qubits via: chains, anti-chains, equivalences

  * •

Relating qubits to classical values via pins

  * •

Importable and parameterizable macro system via: begin_macro, include,
use_macro

  * •

Macro chaining via: next

  * •

Assertions

  * •

Logical and mathematical expressions

  * •

For loops

  * •

If/else conditionals

  * •

Support for the following classical types: Iterator, Range, Int, Float, Bool

  * •

Support for the following quantum data types: Qubit, Ancilliary, QubitArray,
Register

These features are supported by helper functions in the parser class such as
macro, if, assert, etc. which each help to parse the corresponding feature.

##  3 Discussion

JavaScript (JS) has traditionally been used primarily for implementing re-
activity in web frontends, and like Python is not a strongly typed language.
As a result, the language’s implementation does not natively lend itself
especially well towards object oriented programming (OOP). JS moves extremely
quickly and is arguably the most popular programming language of any kind
today [1]. With its speed and flexibility come some trade-offs. For example,
JavaScript is arguably the programming language that supports the most
conflicting programming paradigms [6].

However, the flexibility of JavaScript yielded the expectation that it can be
run anywhere. This has made optimizing JavaScript for constrained environments
a focus for the JavaScript community. These efforts have yielded various
methods of code minimization, optimization and portability that have become
ubiquitous in web programming. It is also one of the motivations behind the
creation of WebAssembly (WASM) [7]. WebAssembly is a language that addresses
the safety, speed and portability of web code. WASM is primarily used as an
intermediate compilation target for JavaScript. A future direction for this
work might be to produce an optimized WASM distribution of each parser.

Another JavaScript derivative language is Microsoft’s TypeScript. TypeScript
was developed with the goal of introducing an optional types system to
JavaScript. This makes TypeScript a more appealing language to use than
vanilla JavaScript for any application that benefits from typing. Language
definition is definitely one such application. Microsoft has begun writing
experimental languages in TypeScript as well. For example, Microsoft published
a new language called Bosque that is written exclusively in TypeScript [9].

What is the connection between the web and quantum computing? Hybrid quatnum-
classical algorithms and quantum cloud computing are the answer. In a
theoretical hybrid quantum cloud computing scenario, a programmer of an end-
user application desires to write an application that can be accessed through
a typical mobile or web interface. He/she expects a commercial quantum cloud
computing resource to at least be accessible as a service through an
understandable web based Application Programming Interface (API). Since QMASM,
QASM and BlackBird are programmer’s entry points to using IBM, Xanadu and
D-Wave’s quantum systems, bringing these into the world of the web via npm
packages is a step towards making hybrid quantum cloud adoption a possibility.

## Acknowledgment

Thank you for 550 downloads in the last year.

## References

  * [1] Stephen O’Grady —@sogrady —May 16, Stephen O’Grady, and Name.  The redmonk programming language rankings: January 2023, May 2023.
  * [2] Adriano Barenco, Charles H. Bennett, Richard Cleve, David P. DiVincenzo, Norman Margolus, Peter Shor, Tycho Sleator, John A. Smolin, and Harald Weinfurter.  Elementary gates for quantum computation.  Physical Review A, 52(5):3457–3467, 1995.
  * [3] Paul I. Bunyk, Emile M. Hoskinson, Mark W. Johnson, Elena Tolkacheva, Fabio Altomare, Andrew J. Berkley, Richard Harris, Jeremy P. Hilton, Trevor Lanting, Anthony J. Przybysz, and Jed Whittaker.  Architectural considerations in the design of a superconducting quantum annealing processor.  IEEE Transactions on Applied Superconductivity, 24(4):1–10, 2014\.
  * [4] Andrew W. Cross, Lev S. Bishop, John A. Smolin, and Jay M. Gambetta.  Open Quantum Assembly Language.  arXiv e-prints, page arXiv:1707.03429, July 2017.
  * [5] Andrew W. Cross, Ali Javadi-Abhari, Thomas Alexander, Niel de Beaudrap, Lev S. Bishop, Steven Heidel, Colm A. Ryan, Prasahnt Sivarajah, John Smolin, Jay M. Gambetta, and Blake R. Johnson.  OpenQASM 3: A broader and deeper quantum assembly language.  arXiv e-prints, page arXiv:2104.14722, April 2021.
  * [6] Sanja Delvcev and Dravzen Dravskovic.  Modern javascript frameworks: A survey study.  2018 Zooming Innovation in Consumer Technologies Conference (ZINC), pages 106–109, 2018.
  * [7] Andreas Haas, Andreas Rossberg, Derek L. Schuff, Ben L. Titzer, Michael Holman, Dan Gohman, Luke Wagner, Alon Zakai, and JF Bastien.  Bringing the web up to speed with webassembly.  In Proceedings of the 38th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2017, page 185–200, New York, NY, USA, 2017. Association for Computing Machinery.
  * [8] Nathan Killoran, Josh Izaac, Nicolás Quesada, Ville Bergholm, Matthew Amy, and Christian Weedbrook.  Strawberry Fields: A Software Platform for Photonic Quantum Computing.  Quantum, 3:129, March 2019.
  * [9] Mark Marron.  Regularized programming with the bosque language.  Technical Report MSR-TR-2019-10, Microsoft, April 2019.
  * [10] N. David Mermin.  Quantum Computer Science: An Introduction.  Cambridge University Press, 2016.
  * [11] Scott Pakin.  A quantum macro assembler, 2016.