Intel® Quantum SDK
Forum related to Intel Quantum SDK, a full-stack software kit for programming and executing algorithms on simulated quantum hardware.
37 Discussions

Hybrid Quantum-Classical application tutorial

KevinR_Intel
Moderator
2,557 Views

Look for upcoming sessions of introductions to the features and programming applications with the Intel® Quantum SDK.

 

Attached are updated versions an example of a hybrid quantum-classical application, a variational quantum eigensolver. It contains the essential components of processing information in both classic bit representation and quantum qubit representation.

 

This example solves a single matrix, but can be extended with the Intel® Hybrid Quantum-Classical library https://github.com/IntelLabs/Hybrid-Quantum-Classical-Library  to treat arbitrary matrices.

KevinR_Intel_0-1678051120869.png

 

 

7 Replies
joshdumo
Novice
2,518 Views

Hi,

I am trying out the example and am getting an error when running the executable simple_vqe, something about GLIBC.

Please assist.

joshdumo_0-1678728673266.png

 

0 Kudos
KevinR_Intel
Moderator
2,515 Views

Hi Josh,

It's because you're trying to run on the login node. The login node is only there to provide communication and access to the job queue.

To use the compile_and_run.txt as a job script, put it in the same directory as simple_vqe.cpp, remove the '.txt' suffix, and type

qsub compile_and_run

The 'qsub' command submits the "job script" to the machine and when it's turn in the queue comes, your job runs. If you read compile_and_run, it is basically just the sequence of things you would have typed if you had done then yourself on the Command-Line-Interface.

 

The output of your job will be in the file 'initial_test.oNNNN' where the NNN's are the number of your job in the total queue. Alternatively, you can also modify the source code to write out any data you'd like to preserve.

joshdumo
Novice
2,508 Views

Thank you for the prompt assist.

Previously I was running "qsub compile_and_run_vqe.txt" still with the suffix attached.

 

I then followed the correct outlined procedure but still i get no output, instead getting 'No such process'. Please find attached the screenshot.

joshdumo_0-1678747439288.png

 

0 Kudos
KevinR_Intel
Moderator
2,505 Views

I omitted a step in explaining how to modify the .txt to become a job file, and that may be causing the error. Try changing the first line of the script to

#!/bin/bash

i.e., remove 1 "#".

 

Adding an extra # was necessary because the forum wants to protect you from downloading a potentially-immediately dangerous file, and considers bash scripts to be to ready-to-go.

 

Also check to make sure that the end of the compile_and_run_vqe has the lines

# move to the directory run the executable
cd vqe_outputs/
./simple_vqe

 

0 Kudos
joshdumo
Novice
2,495 Views

Hi Kevin,

 

I have tried running with the updated simple_vqe and compile_and_run_vqe. This time the compilation has errors. Please see screenshot and attached job output.

joshdumo_0-1678881467298.png

 

 

0 Kudos
KevinR_Intel
Moderator
2,490 Views

That simple_vqe.cpp was stale--it used the beta version API calls and that is what the compiler is (rightly) complaining about. That is my mistake; I've uploaded an updated version that is consistent with version 1.0.

 

TLDR:  I uploaded the .cpp file from the wrong directory.

joshdumo
Novice
2,489 Views

Hi Kevin,

 

The updated version runs as expected. Thank you very much for the support!

joshdumo_0-1678913902145.png

 

0 Kudos
Reply