Questions tagged [programming]

For questions about writing code to be executed on a quantum computer, or to more generally simulate some aspect of it. For questions about a specific programming language, please also include a more specific tag.

Filter by
Sorted by
Tagged with
3
votes
1answer
87 views

Simulation of a helium molecule using Qskit

I am trying to compute the ground state energy of He-He using VQE. For this purpose I have utilized Qskit and have written the following script: ...
4
votes
2answers
127 views

Computing expectation value of product of observables in PennyLane

In PennyLane, the following circuit returns the expectation value of the PauliZ observable on qubit (wire) 1: ...
3
votes
1answer
53 views

Visualizing nice circuits in Qiskit

This is what drawing a circuit looks like in the Qiskit textbook: and this is the ugly version I am stuck with in my own notebooks: On their Prerequisites page they write: However, there is no ....
0
votes
3answers
221 views

What qiskit version?

How do I find out what version of qiskit I am running?
3
votes
1answer
61 views

Cirq: n-qubit GHZ state

I am trying to write $n$ party GHZ state but at the end of the day, it seems like bi partite state. I am missing a detail. Here is my code ...
6
votes
1answer
188 views

Q# Simulation Behavior

I am attempting to run a series of tests on a Q# program I'm running on the local simulator, but I'm not seeing any way to use >1 shot and collect the results of those shots at once, as in ...
2
votes
1answer
59 views

Qiskit: getting QAOA expectation

Suppose I run the Qiskit's QAOA algorithm. qaoa = QAOA(operator=qubit_operator, p=p, optimizer=optimizer) result = qaoa.run(quantum_instance) There is a built-in ...
3
votes
2answers
96 views

Question on practical quantum computing programming code [duplicate]

Has anyone tried any quantum computing programming code that shows or demonstrates the advantage of a quantum computer over classical computers? Thanks a lot.
5
votes
1answer
121 views

How to read the unitary matrix of a quantum circuit in ProjectQ?

I would like to read the unitary matrix of a quantum circuit in ProjectQ. Is there any way to do it?
2
votes
1answer
64 views

Cirq: Result of rotating qubit measurements never come [0 1] or [1 0 ], always come as [0,0] or [1,1]

I am creating a 2 qubit entangled state: ...
2
votes
1answer
67 views

How to use Initial States in Qiskits QAOA?

The class QAOA from qiskit: https://qiskit.org/documentation/stubs/qiskit.aqua.algorithms.QAOA.html has the parameter initial_state from the type InitialState. https://qiskit.org/documentation/apidoc/...
2
votes
2answers
126 views

What are the available compilers for Trapped-Ion Quantum Computing Architecture?

I am looking for a compiler to compile a high-level quantum circuit for the Trapped-Ion Quantum Computing architecture, i.e. a compiler that can translate a high-level circuit to native gates of the ...
2
votes
2answers
70 views

Error When Importing from qiskit.aqua

Qiskit Aqua raises the following exception: ImportError: dlopen: cannot load any more object with static TLS I don't understand what might be causing this. I ...
1
vote
1answer
28 views

Q# Callable Not Accessible from Open Namespace

I am trying to to call ApplyMultiplyControlledAnd(), and I'm receiving an error saying "The callable ApplyMultiplyControlledAnd exists in an open namespace, ...
1
vote
2answers
29 views

Why did “job_manager” submit the same job twice and how to fix it?

In order to avoid the problem posted in Why "job_manager" did not submit some of the jobs?, (the current issue is related but quite different, so I think it is more appropriate to ask ...
-3
votes
1answer
55 views

Query on the HHL Algorithm in the Qiskit Aqua Library [closed]

This is a question regarding the Qiskit Aqua package. I have been studying HHL algorithm from QISKIT textbook and after understanding the math I finally got to the code part, I am having a hard time ...
3
votes
1answer
92 views

In Simon's algorithm, is there a general method to define an oracle given a certain periodicity?

I have to implement Simon's algorithm in Cirq. I have problems determining the oracle $f(x)$ defined such that $f(x)=f(x\oplus a)$ from a certain value of $a$. Given a random $a$, is there a general ...
3
votes
2answers
47 views

Why “job_manager” did not submit some of the jobs?

I tried to submit around 2000 circuits with "job_manager", and it turns out that some jobs are not submitted. Please see the code and error message below. I understand that we can submit max ...
1
vote
0answers
27 views

Why do I get the error 'IBMQManagedResultDataNotAvailable'?

I'm trying to use IBMQ job manager to submit a list of quantum circuits (300 of them in total) to 'ibmq_16_melbourne'. This is what the job status looks like on IBM Quantum Experience: I don't know ...
1
vote
0answers
49 views

Why qiskit.execute runs much slower for inputs with multiple circuits, and how to speed it up?

I am using the "execute" in qiskit to run experiments for two circuits, and it turns out that "execute" runs much slower if the two circuits are run simultaneously, compared to if ...
2
votes
1answer
89 views

Can I access device specifications of IBMQ paying devices?

I need to perform some tests for my thesis in real quantum computers, however, I only have access to IBM's free quantum devices (the maximum number of qubits I can use is 15, in ...
1
vote
2answers
54 views

An issue in plotting the quantum circuit using latex

Here's the code I'm working on: !pip install pylatexenc !pip install pillow qc = QuantumCircuit(2) qc.x(0) qc.cz(0,1) qc.x(0) qc.draw('latex') However there's an ...
2
votes
1answer
50 views

How to improve accuracy of ground energy values from a VQE

Using the Qiskit textbook I have been using a VQE to find the ground state energy of Hydrogen at different interatomic distances on a quantum machine. However, the average energy value I will always ...
0
votes
1answer
56 views

how to plot probability histogram and/or bloch sphere of single qubit in multi-qubit quantum circuit in Qiskit?

How can I get statevector and/or blochsphere representation of qubits of my choice. For example I have 3 qubits with different gates being applied on each qubit. the qiskit state_vector simulator ...
1
vote
1answer
106 views

Qubit ordering in qiskit

I am confused about the qubit ordering in circuit diagrams and endianness used in qiskit. As far as I understand, qiskit uses little endian (least significant qubit is rightmost) and while drawing ...
-2
votes
1answer
64 views

How to deal with job submission error in IBM? [closed]

I keep on getting this error no matter how many circuits I run in the backend 'ibmq_athens'. It says 'Max retries exceeded with URL'. Can someone explain why I am getting this error message. The main ...
0
votes
1answer
76 views

A problem with application of multi controlled rotation gates [closed]

This message pops up when I run an mcrx gate The mcrx gate needs a single qubit as target. Here is a part of code I run: ...
1
vote
1answer
37 views

Source code for graphsim

The source code for the graph state simulator from "Fast simulation of stabilizer circuits using a graph state representation" is supposed to be at http://homepage.uibk.ac.at/homepage/c705/...
2
votes
1answer
116 views

Job fails when using PulseSimulator: Job Status: job incurred error

I'm trying to simulate a basic circuit using the PulseSimulator in Qiskit. The following Qiskit Pulse code works when I run it on the real device, but not when ...
2
votes
1answer
43 views

Quantum PRGN against Hard disk Forensics

We can make use of the Qbit to make a random string of bytes then as I have an office laptop and I can do some espionage by copying the files to my local disk from the network share and upload it to ...
2
votes
1answer
96 views

Qiskit's c_if and conditioned operations on a real quantum computer

Can Qiskit's c_if be used on a real quantum computer of IBM? And if it can, can it put a condition only on Qiskit gates like X, H, U1, U2, etc, or is there some way ...
2
votes
1answer
103 views

Expectation value of operator - python

I am suposed to solve following problem: Calculate the probability $P_n(x > X)$ that a particle in then n-th eigenstate is found at a position with an x-value larger than X. Here it is convenient ...
1
vote
2answers
78 views
3
votes
1answer
55 views

How to decompose/unroll a Qiskit Arbitrary initialization

I'm aware that to randomly initialize a quantum circuit with Qiskit, we can simply write qc.initialize(rand_state, q[0]...). However, when drawing the circuit, I see that the "initialize" ...
3
votes
1answer
42 views

Issue with Speed of Qiskit Arbitrary Initialization

I've been using a circuit that needs a specific initialization in the beginning, and to do so I've been using qc.initialize() as mentioned in previously asked similar questions (How can I create an ...
2
votes
1answer
110 views

Qiskit installation

I'm trying to get started with Qiskit but the installation process has been horrendous and the official instructions are unusable. The latest python doesnt work with the install instructions at: https:...
0
votes
1answer
73 views

Braket and Q# Simulators

I have implemented Shor's algorithm in Qiskit, and everything works as expected within the IBM Q experience for both the IBM qasm_simulator and real hardware. However, after I've implemented Shors in ...
3
votes
0answers
119 views

Implemented QAOA returns wrong result

I try to apply QAOA algorithm to find minimal energy state of the Hamiltonian: $H_A = \frac{1}{2}\sigma_z^1 + \frac{1}{2}\sigma_z^1\sigma_z^2$ It is expected that with p=2 my variational should ...
1
vote
0answers
68 views

How can I fix the BrokenProcessPool error in Qiskit?

I'm running a set of quantum circuits using the ibmq_qasm_simulator. However, sometimes my code works for the simulation, but sometimes it doesn't, and the system ...
2
votes
2answers
80 views

Qiskit Controlled S and Controlled T Gates

I was implementing controlled S and T gates in qiskit and was wondering if there is any difference between using the cu1 and crz ...
4
votes
3answers
217 views

Simple Hadamard Circuit gives incorrect results?

I am running the simplest Hadamard circuit possible - one qubit, initialised to 0, apply H gate, measure in Z basis. When I run the circuit on the simulator I obtain the expected result (50% in 0, 50% ...
1
vote
1answer
122 views

What is the best learning path for quantum computing? [closed]

Looking for a starter point for a professional training as a Quantum Computer programmer. Is a master in Computer Science XOR Applied Physics a good starting point?
2
votes
1answer
35 views

Qiskit PauliWeightedOperator in the matrix representation?

Suppose we have a PauliWeightedOperator object from Qiskit. Is there any built-in method to convert it to the matrix representation in the computational basis? My search in the docs was not successful....
3
votes
0answers
42 views

Run VQE for parametrized quantum circuit with ancilla qubits

Let's say we have the following circuit (picture and code shown below), and now the $q_0$ is an ancilla qubit. If the system of interest has only two qubits, Is there a way to use only $q_{1,2}$ as my ...
2
votes
1answer
54 views

How do Hadamard and CNOT gates work on Qiskit SDK? Why is the output reversed?

Here is the code that I have been using on IBM Q Experience (should be the latest version of Qiskit). From my understanding it seems like the outputs of Hadamard and CNOT gates are reversed in a 2-...
3
votes
1answer
50 views

How can I run a set of circuits, each of which has 100 shots?

I'm running simulations of my quantum circuit, which includes both parametrized variables and random numbers. The question I'm trying to solve is that for each parameterized variable, I will generate ...
0
votes
1answer
23 views

How can I fix this parametrization error in Qiskit?

I'm trying to use the parametrized circuits to run a single model of quantum circuit with different values. Here's part of my code: ...
1
vote
2answers
63 views

Shor's implementation problem on qiskit

If q4-7 are all supposed to be eigenstates of the operation, why is it just that q7 is in $|1\rangle$? Shouldn't all qubits 4 to ...
1
vote
0answers
37 views

Differences between Extractors and Privacy Amplification for Quantum Random Generators

We know that for the last step of QRNG: we need to separate quantum and classical noises from each other so we use extractors, after extractor we need privacy amplification step. At this point: if ...

1 2 3
4
5
19