Quantum computing SDK blueqat on amazon lambda serverless.

Yuichiro Minato
Nov 4 · 2 min read

First

We did installing blueqat quantum computing SDK on ec2 and flask before.

Now we try lambda function to get serverless environment.

lamba?

Lambda is an event driven serverless service provides aws. You don’t have to manage the server resources.

What we do

What we do is to design the input and output of lambda function.

Let’s try first just looking at lambda.

This is an example of “Hello from Lambda”. And we now want to input quantum circuit like “h”

Lambda file is changed to get the input of the circuit

We have a response on

We have correct output. And now we change a little bit to response for input quantum circuit.

and we have correct output now.

Introduce a package for lambda

We need blueqat,numpy and scipy for lambda now. First we prepare the installation on blueqat on the current directory of your computer to have a package.

And let’s put lambda_function.py at the same directory

lambda_function.py

Lambda layer

Now we need numpy and scipy for blueqat, but these are too large to upload into lambda.

Now we have lambda layer which prepares files usually used in lambda like numpy and scipy.

We select lambda layer. Finally we just need blueqat folder (and we don’t need numpy and scipy anymore for uploading the file from lambda.)

After deleting numpy and scipy from the blueqat installed directory

We get the file to upload to the lambda server.

Testing

Let’s do the test.

Now we have correct response from the lambda server. Using this scheme we can make a lot of services through API with serverless quantum computing SDK.

MDR Inc.

quantum computing company in Tokyo

Yuichiro Minato

Written by

MDR, Quantum Computing@Tokyo, https://mdrft.com/

MDR Inc.

MDR Inc.

quantum computing company in Tokyo

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade