2022 Developer Survey is open! Take survey.

Questions tagged [programming]

For any questions whose answer is expected to require code or programming notions. For questions about a specific framework (e.g. qiskit or cirq) please also include a more specific tag.

Filter by
Sorted by
Tagged with
0 votes
0 answers
3 views

What are the differences between discrete-time quantum walks between dimensions?

When working with quantum walks in other dimensions (1D – 2D – 3D...) do your results tend to be different from what is proposed in theory with the probability density? The results obtained in the ...
user avatar
  • 47
-2 votes
0 answers
83 views

PhD topics in quantum computing [closed]

I am looking for PhD topics in quantum computing related to computer Engineering background (I don't have a background in physics). I tried searching for Machine learning, neural networks and Quantum ...
user avatar
2 votes
2 answers
59 views

qiskit qaoa.compute_minimum_eigenvalue

I am having some trouble running the compute_minimum_eigenvalue method from qiskit's QAOA: the documentation states that one ...
user avatar
0 votes
1 answer
37 views

Performance metrics in QSVM

I have implemented QSVM on breast cancer dataset using link: "https://qiskit.org/documentation/stable/0.24/tutorials/machine_learning/01_qsvm_classification.html" but unable to compute other ...
user avatar
0 votes
1 answer
22 views

Converting data into a SHA256 hash using Qiskit quantum computer

I was wondering how can we convert data into a hash using Qiskit quantum computer? e.g, this code below will generate a SHA256 hash based on random data. ...
user avatar
0 votes
0 answers
14 views

Is there a way to connect a IBM quantum lab code to an Unreal Engine project?

I would like to know whether someone tried this before, I'm interested in be able to connect this tools. I know that Unreal Engine has a plugin to program with python, that all I know. I'll really ...
user avatar
1 vote
2 answers
30 views

How is the ket of a quantum state calculated in this code?

For the following code qc = QuantumCircuit(2) qc.h(1) qc.cx(1,0) ket = Statevector(qc) ket.draw() the output will be the following: ...
user avatar
0 votes
2 answers
45 views

Expectation value of pauli strings for VQE

I am studying VQE and have boiled it down to a matter of determining the expectation value of pauli strings: $$\langle H \rangle = \sum_i \alpha_i \langle\psi|\hat{P_i}|\psi\rangle.$$ I have been ...
user avatar
0 votes
0 answers
58 views

Hamiltonian & QubitMappingType cannot be imported from qiskit.chemistry.core

I'm trying to implement the same Jupyter notebook in The Variational Quantum Eigensolver — Programming on Quantum Computers — Coding with Qiskit S2E4;however,I found a problem: Error: ...
user avatar
  • 11
0 votes
0 answers
18 views

Why does Qsample encoding require N Qubits for encoding size N probability distribution?

I'm reading Supervised Learning with Quantum Computers book https://link.springer.com/book/10.1007/978-3-319-96424-9. In the data encoding section, Qsample encoding is one of the techniques to encode ...
user avatar
2 votes
1 answer
31 views

Iterative quantum phase estimation - real device

I'm trying to implement the iterative quantum phase estimation on a real (IBM) quantum computer. I'm using the code below. When I run this code on a simulator the results are the expected ones, but ...
user avatar
0 votes
1 answer
13 views

why is the ImFil optimizer history not completly printed?

I use the [scikit-quant] (https://scikit-quant.readthedocs.io/en/latest/starting.html) implementation of the ImFil optimizer. I want to plot the objective function values vs. iteration number and thus ...
user avatar
1 vote
1 answer
57 views

Help with objective function definition for CQM problem

I would like to set my problem as a constrained quadratic model (CQM), since a CQM allows users to explicitly define objective and constraints (easier for me, as I am not a QC expert!). The idea is to ...
user avatar
  • 11
1 vote
0 answers
46 views

Are there any quantum standards already in development and accessible as draft documents?

Are there any quantum standards already in development and accessible as draft documents? Any documents describing standardized way of describing and ensuring common meaning/interoperability, like e.g....
user avatar
  • 354
2 votes
2 answers
95 views

Qiskit compute mean expectation value

I want to calculate the mean expectation value of an PauliSumOp within qiskit after I executed a QAOA Circuit. My approach is the following: ...
user avatar
0 votes
1 answer
28 views

split_dataset_to_data_and_labels in qiskit not working correctly

I am using source code of split_dataset_to_data_and_labels as I am unable to install qiskit-aqua because of error. But in that source code, "keys" is not being identified. I am using qiskit'...
user avatar
1 vote
1 answer
27 views

Unable to import split_dataset_to_data_and_labels and map_label_to_class_name in qiskit

I was using command-: from qiskit.aqua.utils import split_dataset_to_data_and_labels, map_label_to_class_name but it was giving error-: ...
user avatar
1 vote
2 answers
50 views

Can one reset a qubit to the ground state on real IBM quantum processor?

As explained here, IBM provided the possibility to reset a qubit to the ground state within the Qiskit framework. However it is not clear whether this tool is available for any backend or it works ...
user avatar
1 vote
1 answer
18 views

Fail to add amplitude damping error to NoiseModel

I am reading a book named Learn Quantum Computing with Python and IBM Quantum Experience authored by Robert Loredo. When I tried to run the code on Chapter 11, I followed the instruction and wroted ...
user avatar
  • 11
-1 votes
1 answer
42 views

No module named 'qiskit.optimization' on Google Colab

I have qiskit installed in my colab runtime and can import qiskit, but I can not import anything from qiskit.optimization. Am I missing something? EDIT: It seems ...
user avatar
4 votes
0 answers
54 views

How to implement a gate that generate a uniform superposition of all permutation of element

I'm looking for a quantum circuit that permits generating a uniform superposition of all possible permutations for example if we have as input $|0123\rangle$ the output will be the uniform ...
user avatar
-1 votes
0 answers
25 views

understanding docplex output in portfolio optimization using Qiskit

Can someone please explain the below equation? what are we doing in Obj? Source: https://qiskit.org/documentation/finance/tutorials/01_portfolio_optimization.html ...
user avatar
0 votes
1 answer
30 views

Generating a random 32-byte hex integer using Qiskit

Hello I posted here yesterday about generating random 16 digits using Qiskit, and a gentle guy helped me but how about a string? How can I generate random 256 bit key in hex format in a superposition ...
user avatar
1 vote
2 answers
57 views

How do I use the quantum searching algorithm to loop search through a datafile in qiskit?

I have a localhost index.html has a table contains names and address and balances etc... also there is a search bar on the home page to go through the pages, the interesting thing is, there is loooot ...
user avatar
2 votes
1 answer
40 views

Question about mock backends!

I recently learned about the mock backends or the fake backends provided by Qiskit and I was wondering, do they behave the same way IBMQ systems backends like (ibmq_brooklyn)? also, can I depend on ...
user avatar
1 vote
1 answer
89 views

When using Qiskit's plot_bloch_vector function, how can I set colors for vectors?

I am able to visualize vectors on a bloch sphere using Qiskit as follows: ...
user avatar
0 votes
1 answer
46 views

Generating a random 16-digits in a superposition state using Qiskit

Im trying to create a script using Qiskit for a days but somehow i couldn't seem to get it done!! Im new to QuantumComputing, so pardon me if i don't explain something properly. I need to create a ...
user avatar
2 votes
1 answer
554 views

How does a quantum computer find the correct password faster than classical computers using brute-force?

I didn't get this part right! For example, we have an online box with a 16-digit password, and we don't know what the password is! How can a quantum computer find the correct password faster than ...
user avatar
1 vote
1 answer
70 views

Why Qiskit doesn't invert hard coded unitary matrix?

I was expecting Qiskit to do a upside down version of my unitary as it does for other unitary matrices of CNOT and Toffoli gates given in textbooks : if you convert a toffoli matrix from quantum ...
user avatar
1 vote
1 answer
336 views

Why is the combination of NTRU Prime and X25519 ECDH in OpenSSH believed to be secure against quantum attacks?

What do you think about the combination of NTRU Prime and X25519 ECDH in OpenSSH 9.0? Why is the combination of NTRU Prime and X25519 ECDH in OpenSSH believed to be secure against quantum attacks in ...
user avatar
0 votes
1 answer
26 views

What’s the proper gate use for the following code? (Python)

I am trying to find a proper way to write a code that will give me the resulting quantum state $i|10\rangle$ using qiskit in Python (using Jupiter notebook). I think I have figured out that the ...
user avatar
  • 103
0 votes
1 answer
38 views

Qiskit histogram to Seaborn

I am running certain circuits in the Aer simulators and I need to present them nicely. I prefer to use the options provided by Seaborn. How can I transfer my Aer data, e.g. histograms, to Seaborn? For ...
user avatar
  • 409
0 votes
1 answer
59 views

Enable qiskit backends in google colab

I am trying to enable backends by using qiskit.IBMQ.backends() methods in google colab. but it is showing error. How to enable this? AL time this backend showing an error. i have tried by using some ...
user avatar
  • 19
0 votes
0 answers
21 views

Qiskit - How to extract part of Hamiltonian?

Working on electronic structure problems, the Hamiltonian in second quantization is given by $$ \widehat{H} = \sum_{pq} h_{pq} \widehat{E}_{pq} + \frac{1}{2} \sum_{pqrs} g_{pqrs} \widehat{e}_{pqrs}, $$...
user avatar
  • 177
1 vote
1 answer
41 views

Qiskit - nuclear repulsion energy derivative

I know a function in PSI4 computing a nuclear repulsion energy derivative located in psi4.core.Molecule. Is there a possibility to access such function from Qiskit interface? By this "interface&...
user avatar
  • 177
1 vote
0 answers
22 views

keras agents fails in DQNAgent using PQC during clonation for target

I have some issues using keras-rl2 with tensorflow_quantum and VQC (using identical architecture as https://www.tensorflow.org/quantum/tutorials/quantum_reinforcement_learning) After the creation of ...
user avatar
0 votes
1 answer
45 views

Calculating counts from statevector in Qiskit

In Qiskit, how are counts calculated from statevectors ? For example ; ...
user avatar
0 votes
1 answer
35 views

Qiskit: bind parameters to sub-circuit

I am trying to implement a Hadamard test on a parametrized sub-circuit $V(\bf{a})$. I create an outer circuit and then append the parametrized $V(\bf{a})$ to it. ...
user avatar
  • 45
4 votes
2 answers
185 views

How can I visualize a stim circuit?

Is there any function I can call to visualize a stim circuit?
user avatar
  • 187
1 vote
0 answers
49 views

What's meaning of the expression like "Qubit[] => Result"

In Q#,there are lots of expressions like "Qubit[] => Result". It can be the type of return result,like this: ...
user avatar
2 votes
1 answer
46 views

Second quantized $S^2$ operator in Qiskit

Is it possible to obtain easily the second quantized $S^2$ operator in Qiskit, preferably from ElectronicStructureProblem? I'm obtaining Hamiltonian via second_q_ops() method, accessing property ...
user avatar
  • 177
0 votes
1 answer
20 views

How to caculate the resources used by an operation when the operation receives arguments?

I want to use Q# to evaluate the real resources of an operation, but some problems happen. I want to evaluate the resource of training model operation for the example of half-moons data classification....
user avatar
0 votes
1 answer
35 views

Qiskit PrimitiveOp compose function giving weird output

I am executing the following code. ...
user avatar
  • 121
2 votes
2 answers
117 views

Remove Inactive Qubits from Qiskit Circuit

Is there any way to remove unused/inactive qubits from my Qiskit circuit? For example, I have the register $x0\_float$ who has an unused qubit $x0\_{float}_0$ (see image), For context, my code is ...
user avatar
1 vote
2 answers
49 views

How to caculate the inner product of two vectors with Q#

For example, if $a$ is a row vector, $b$ is a column vector, how to use Q# to calculate the inner product of these two? Which method or operator can be used? Just $a*b$? Any others? Really need your ...
user avatar
1 vote
1 answer
59 views

Tuning hyperparameters of QSVM

While implementing QSVM algorithm and I am facing some problems. I followed this tutorial: https://qiskit.org/documentation/stable/0.24/tutorials/machine_learning/01_qsvm_classification.html While ...
user avatar
3 votes
1 answer
88 views

Databases for Quantum Computing & Quantum Computers - Do we need to create new databases?

Recently, I asked a question about programming languages that can be compatible with quantum computers. Link to the question here: Will standard programming languages be applicable for quantum ...
user avatar
  • 173
0 votes
1 answer
33 views

Result and IQArray could not be found

I am following this MS tutorial to add functionality to my Q#/C#host project. However, I get two errors on my operations: ...
user avatar
  • 143
0 votes
1 answer
140 views

Hybrid Quantum LSTM in Qiskit

I read this article on a Hybrid Quantum LSTM in Pennylane and I'm trying to replicate it in Qiskit. Nevertheless it doesn't seem to work very well. Here's my code ...
user avatar
  • 115
2 votes
1 answer
32 views

Efficient Representation of Qubits on a Digital Simulator

I was wondering about quantum simulators recently, and I was thinking about how a qubit could be represented on a digital machine. This Stack Overflow post seems to say that one will need at least $a2^...
user avatar

1
2 3 4 5
27