New answers tagged

0 votes

Converting data into a SHA256 hash using Qiskit quantum computer

There is no current implementation of SHA256 in Qiskit. Reasons for that include: its implementation could be rather complicated, including a large number of ancilla qubits; it would require a huge ...
user avatar
0 votes

Help with objective function definition for CQM problem

It looks like you want to loop the matrix, correct? My question is why you can't calculate the absolute value between two distinct elements in your matrix? Can you please explain you question clear. ...
user avatar
1 vote
Accepted

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

In case the bra-ket notation is new to you, the calculations are fairly basic linear algebra. Your starting state is the tensor product $$(q_0)_{init} \otimes (q_1)_{init} = \vert 0\rangle\otimes\...
user avatar
0 votes

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

The statevector in the notation of kets are just a superposition of qubits with the registers as the index and the values as the amplitudes, e.g. for the output statevector you gave, you would have $0....
user avatar
0 votes

Hybrid Quantum LSTM in Qiskit

Ok, so my recomendation is to use CircuitQNN and use the probs as output. That will solve the issue of speed and convergence at the same time. I used embedding_dim = 8, hidden_dim = 6 and 3 qubits
user avatar
0 votes

Expectation value of pauli strings for VQE

In addition to the issue mentioned by @KAJ226 in his answer, this line of code is wrong sign = (state.count('1') % 2) * (-1) because ...
user avatar
0 votes

Expectation value of pauli strings for VQE

To measure $\langle XY \rangle$ you need to apply $H$ gate to the first qubit since $HZH = X$, and $S^\dagger$ follow by $H$ to the second qubit since $(SH)Z(HS^\dagger) = Y $. Now, Qiskit uses ...
user avatar
  • 12.3k
0 votes
Accepted

Iterative quantum phase estimation - real device

Dynamic circuit capabilities (eg., circuits with control flow) are not yet supported by production IBM hardware. These capabilities will be coming later in 2022 to select devices as per the IBM ...
user avatar
  • 636
0 votes

Qiskit compute mean expectation value

Qiskit provides a high-level constructs that can be used to calculate the expectation value. You don't have to do this low-level calculations by yourself. First, use ...
user avatar
1 vote
Accepted

Qiskit compute mean expectation value

Yes, StateFn(Bitstring) is a valid usage of qiskit in terms of StateFn("0101")=$\left|0101\right\rangle$. As an ...
user avatar
  • 1,626
0 votes

why is the ImFil optimizer history not completly printed?

I am not familiar with that package but I have checked source code quickly: \scikit-quant\opt\imfil\python\SQImFil\_optset.py This seems to be confusing ...
user avatar
  • 354
1 vote

Qiskit sample - Portfolio optimization

Well you can fix it also. Like if you want to take 3 assets. THEN TAKE BUDGET=3. [BUDGET IS THE NO OF ASSETS U WANT TO SELECT OUT OF TOTAL ASSETS(num_assets)] Now your number of assets can be 5, 10, ...
user avatar
1 vote

Bernstein Vazirani Algorithm widget (bv_widget) in the Qiskit documentation

With qasm simulator with qiskit and the inner-product quantum oracle (parameterized by the secret bits and leveraging the phase-...
user avatar
0 votes

Implementation of Unitary in Shor's Algorithm in PennyLane

Yes, it seems to me you apply it in a right way, except some points I listed after. The circuit making $U$ you found is simply a way to check how Shor's algorithm works, and is simply built from the ...
user avatar
  • 21
1 vote
Accepted

split_dataset_to_data_and_labels in qiskit not working correctly

Qiskit Aqua (now deprecated) contains the function ad_hoc_data[1] which returns ...
user avatar
1 vote

Unable to import split_dataset_to_data_and_labels and map_label_to_class_name in qiskit

To fix this issue, required code needs to be copied and applied in python from-: https://github.com/Qiskit/qiskit-aqua/blob/main/qiskit/aqua/utils/dataset_helper.py This is based on Egretta.Thula's ...
user avatar
0 votes

Fail to add amplitude damping error to NoiseModel

Actually, the amplitude damping error added to the NoiseModel successfully. The issue happens because the noisy gates are removed from your circuits before sending ...
user avatar
2 votes

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

As @KAJ226 said in his answer, some of IBM quantum systems support Reset operation. You can check whether some backend supports Reset as follows: ...
user avatar
2 votes

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

Yes, as pointed out by this tutorial here: Mid-Circuit Measurements Tutorial In particular they showed an example of single qubit reset on ibmq_manhattan
user avatar
  • 12.3k
1 vote

No module named 'qiskit.optimization' on Google Colab

Run !pip install qiskit-optimization to install it and import it as qiskit_optimization. Read more about the framework on the ...
user avatar
  • 2,576
1 vote

Question About How Qiskit Reset Gate Affects Other Entangled Qubits

'Internally, these reset instructions are composed of a mid-circuit measurement followed by an x-gate conditioned on the outcome of the measurement.' As I understand it, the reset will collapse the ...
user avatar
2 votes

AWS Braket Backend for Qiskit?

qbraid does! qbraid has a transpiler for Qiskit <> Braket <> Pennylane (QNodes) <> Cirq <> Pyquil which is also backend compatible. You'll have to sign up to access the SDK ...
user avatar
1 vote

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

Before I address your question, I'll mention that the security of a cryptosystem in theory is not really the same as the security of a cryptosystem in practice. The specific reasons why NTRU is ...
user avatar
1 vote

Generating a random 32-byte hex integer using Qiskit

A binary string can be converted into other formats such as decimal, octal and as you require, hexadecimal. As you have already mentioned, you need a 256-bit key. So you can replicate the same method ...
user avatar
2 votes

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

i heard a quantum algorithm can search through a list much more quickly than an algorithm limited by the plodding pace of classical physics Grover's algorithm, also known as the quantum search ...
user avatar
3 votes

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

Currently the state of quantum computers is not advanced enough; while you can run Grover's algorithm on the existing quantum computers, you will not be able to benefit from this in the problem you're ...
user avatar
  • 365
1 vote

Question about mock backends!

According to Qiskit documentation: Note, that these automatic models are only an approximation of the real errors that occur on actual devices, due to the fact that they must be build from a limited ...
user avatar
5 votes
Accepted

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

A simple way to do that is by using Bloch class[1] directly which accepts a list of vector colors to cycle through: ...
user avatar
1 vote
Accepted

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

You need $\lceil d\log_2(10)\rceil$ qubits to store a $d$ decimal digits number. So you can generate a superposition state of binary representation of a 16 decimal digits number using the following ...
user avatar
3 votes

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

In the setting you described we cannot use a Quantum Computer to benefit us. But if we are able to somehow perform the password check itself within a quantum computer, then Grover's algorithm gives us ...
user avatar
  • 365
1 vote
Accepted

Why Qiskit doesn't invert hard coded unitary matrix?

So I have finally have the time to check up with what I wrote in the comment, and what I commented is indeed the case. If I passed in the matrix $U = \begin{pmatrix} 1 & 0 & 0 & 0\\ 0 &...
user avatar
  • 12.3k

Top 50 recent answers are included