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
172 views

How can we construct a control-control y-rotation (CCRy) gate in Qiskit?

Qiskit has a CRy gate, however I couldn't find a CCRy (double control Ry) gate implementation. How can we construct the CCRy circuit given below in Qiskit without any ancillary qubits? Edit: A quick ...
1
vote
1answer
48 views

Qiskit: is there a quick way to work out the spherical coordinates for a given qubit statevector?

I am trying to calculate the spherical coordinates of different qubit states (i.e. working out $\theta$ and $\phi$ from: $|\psi\rangle = e^{-i\phi/2}\cos(\theta/2)|0\rangle + e^{i\phi/2}\sin(\theta/2)|...
2
votes
1answer
43 views

Qiskit: how can you use a different state for each shot in a quantum circuit? [duplicate]

I am trying to run a quantum circuit many times, each time using a different random state - a single qubit i.e. $|\psi\rangle= a|0\rangle + b|1\rangle$ with different $a$ and $b$. Once each qubit has ...
1
vote
2answers
44 views

Multiple Providers on IBMQ

I am attempting to run parallel computations on two different backends from within the same Jupyter notebook, though it appears these two jobs are running sequentially. I understand the jobs will be ...
-2
votes
1answer
38 views

IBMQ.load_account() fails with “403 Client Error” [closed]

I alredy save an account but when I want to laod it I get a error like this how can I fix it ? ...
2
votes
1answer
41 views

How does MCPhaseGate/MCU1Gate works internally in qiskit?

I was curious about the implementation of MCPhase/MCU1Gate and how it works without ancilla qubits. I ended up checking the code of the some auxiliary (?) function ...
4
votes
2answers
71 views

From QUBO matrix to Ising model in Qiskit

Given a general QUBO matrix $Q$ for a quadratic minimization problem, is there a Qiskit way to obtain the Pauli gate list or the Ising model for it? A related question is Qiskit: Taking a QUBO matrix ...
3
votes
1answer
68 views

How can I compose a list of quantum circuits onto different qubits in one command?

This is a follow-up question on composing the quantum circuits. Say if I have the following circuit element: ...
0
votes
1answer
50 views

Can I keep composing a series of quantum circuits into a large quantum circuit?

Suppose I have a series of quantum circuits, each of them has 2 qubits: ...
2
votes
2answers
96 views

How can I convert exponentials of pauli matrices to circuits of this form in Qiskit?

For example the following circuit is for $e^{-i(Z\otimes Z\otimes Z)\Delta t} $ I know this can even be done without the ancilla qubit, having the CNOTs control the last qubit and applying an RZ on ...
2
votes
2answers
154 views

Qiskit: Taking a QUBO matrix into `qubit_op'

I'm trying to solve the maximum independent set problem using Qiskit and the QAOA. I've a nice QUBO Matrix for this simple path graph: as so: My question is, how do I convert this into a general ...
1
vote
0answers
59 views

Transpiler fails after 1000 iterations

I'm transpiling a set of quantum circuits using ibmq_5_yorktown. However, as the number of circuits gets larger, it shows me the following error message: ...
2
votes
0answers
49 views

Calculating exact expectation values on ibmq_qasm_simulator

In order to calculate the exact expectation value of a Pauli operator in some state using local qasm_simulator, I do ...
3
votes
0answers
31 views

Implementation of the “Quantum Verification of Matrix Products” algorithm

I would like to implement a Quantum Verification of Matrix Products, using Ambainis OR Burhman algorithm but I don't know how to start. There isn't much documentation about it, and no circuit in the ...
0
votes
0answers
38 views

IBMQ - Total samples exceeds the maximum number of samples for channel [8002]

I'm trying to run some pulse schedules on ibmq_bogota but I'm running into this error: There are 99 "circuits"/pulse schedules in this job. When I try to ...
3
votes
1answer
108 views

What are the differences between IBMQJobManager and Qiskit aqua QuantumInstance?

I have been using the Qiskit aqua QuantumInstance for a while, and have recently discovered the IBMQJobManager class and the two seem to be quite similar. Are there differences between them? Will they ...
3
votes
1answer
165 views

Can I 'shuffle' the qubits in my circuit?

If I have such a quantum circuit: quanc = QuantumCircuit(5) quanc.crz(np.pi,1,0) quanc.cx(1,[i for i in range(2,5)]) Can I 'shuffle' the quantum circuit, such ...
0
votes
0answers
13 views

Any suggestions on Software to implement Remote Entangled Distribution

I am studying a paper "Remote Preparation and Distribution of Bipartite Entangled States" and trying to implement it using a software. https://arxiv.org/abs/quant-ph/0410016 This paper talks ...
-1
votes
1answer
52 views

Handle Qiskit Excpetion while Loading IBMQ Account using Streamlit

I'm trying to build a simple web app for generating random numbers using IBMQ (Qiskit) and Streamlit. However, if there is no IBMQ saved account it should wait for the user to enter the API token and ...
0
votes
0answers
31 views

Interpret graph nodes as qubits

I am trying implement MAXCUT using QAOA. I have a graph with edges defined by an edges set. My edges set looks a bit like this: ...
4
votes
0answers
88 views

Solving higher-order (unconstrained) binary optimization problems with QAOA without quadratization

I am aware that it's possible to use QAOA to solve QUBO problems. However, I've recently seen some sources mentioning the possibility of solving HOBO/HUBO problems using QAOA as well [1][3]. While I ...
0
votes
1answer
31 views

Accessing tupple data in Q#

I am continuing my work on the SAT katas, but I thing I am missing something on the way the tuple data type works. In this example code, I am trying to access the data in a tuple type : ...
2
votes
0answers
49 views

Qiskit CircuitStateFn.eval() on more than 16 qubits

The definition of Qiskit CircuitStateFn.eval() is as follows: ...
3
votes
1answer
75 views

How can I find a Clifford+T approximation of an arbitrary one qubit gate in Qiskit?

I know the Solovay-Kitaev algorithm can achieve this. Is there an implementation of this or any other algorithm for the same task in Qiskit? Or perhaps some other library that interfaces well with ...
4
votes
1answer
70 views

Can I adjust the quantum circuit after transpiling it?

I have a list of quantum circuits called all_circuits. I tried to run those circuits on a quantum computer by submitting the jobs to the IBM job manager: ...
1
vote
1answer
46 views

processing between sequential executions

Regarding real quantum computers of IBM, can one execute a circuit that contains measurements and afterwards get counts and then, based on the results of measurements (from counts), decide if to build ...
1
vote
1answer
61 views

Generic CNOT gate in qiskit from tensor product

I would like to use qiskit to verify for generalized CNOT gates that, e.g. for 4 qubits \begin{equation} \text{cu(0,3)} = |0\rangle\langle 0|\otimes1\!\!1\otimes1\!\!1\otimes1\!\!1 + |1\rangle\langle ...
2
votes
2answers
152 views

Was the Quantum Circuit Attribute “iden” renamed?

I'm going through some older tutorials for my employer and everything seems to be working fine except the "iden" attribute. The error is listed below. I assume the name was changed but I don'...
3
votes
2answers
109 views

Implementing Grover's oracle with multiple solutions in Qiskit

I want to turn a state $$ |\Psi_1⟩ = \frac{1}{\sqrt{8}}(|000⟩+|001⟩+|010⟩+|011⟩+|100⟩+|101⟩+|110⟩+|111⟩) $$ into $$ |\Psi_2⟩ = \frac{1}{\sqrt{8}}(|000⟩+|001⟩+|010⟩+|011⟩+|100⟩-|101⟩-|110⟩+|111⟩) $$ ...
1
vote
1answer
157 views

Take every second element of the array in Q#

Very quick question, I am trying to implement SAT solving in Q# using Grover's Algorithm. I want to take every second element from an array starting at the second element, represented with a range ...
1
vote
1answer
42 views

Multiply-Controlled X Gate/MCT Gate Implementation

I am currently trying to implement a multi-controlled Toffoli/multi-controlled X gate in Braket, but I am confused as to the general concept of cascaded X gates and other implementations. I've read ...
1
vote
2answers
75 views

Q-Sphere representation of Bell States

I'm currently going through Lab1 of the Qiskit Quantum Computing Course, where one task is to create the Bell State $$\frac{1}{\sqrt{2}}\left(\vert01\rangle + \vert10\rangle\right)$$ Technically it ...
4
votes
2answers
292 views

What's the default value for a quantum register?

I've just started to learn Quantum computing with Qiskit: I'm reading the Qiskit documentation and the book "Quantum Computing in Practice with Qiskit® and IBM Quantum Experience®". In this ...
4
votes
1answer
36 views

Is there a 'retry' logic in job manager?

This is a follow-up question to my earlier post. I'm trying to filter a set of results obtained from job manager, and the following code works when my circuit list doesn't contain too many elements: <...
2
votes
1answer
71 views

API error when trying to access IBM Quantum Computer using IBMQ API Token

I'm trying to write a code so that if the token exists then it loads the account or else it asks the user for the API token. Below is the code for reference: ...
5
votes
1answer
70 views

Pennylane: creating QNodes for large numbers of circuits that only differ by number of wires

Take the following simple quantum function: ...
3
votes
1answer
56 views

Initial state definition for QAOA

There are a few options already discussed and suggested how to pass the initial state to the QAOA module. I tried all but no one works in my case. Maybe, there are any other ideas? So, I created the ...
4
votes
1answer
59 views

Filtering a set of results obtained from job manager

I've already generated a filter for readout error mitigation: ...
2
votes
1answer
105 views

How to simulate the density matrix in Qiskit when using the qasm simulator?

When simulating a circuit using qasm simulator, if there is a depolarizing channel in the noise model, then the results could be mixed states. How can I calculate the density matrix of the mixed ...
5
votes
1answer
39 views

CERTIFICATE_VERIFY_FAILED after updating Python when trying to access results in IBM QE

I had a question earlier about the Numpy DeprecationWarning flooding issue. I just updated the Python in my regular jupyter notebook and have trouble running the following cell: ...
1
vote
1answer
28 views

Can I only use a 'subset' of calibration matrix to reduce measurement errors?

Suppose I have the following calibration matrix generated using 4 qubits: ...
1
vote
1answer
151 views

Numpy DeprecationWarning flooding in IBM Quantum Lab

I'm coding using the Jupyter Notebook in the IBM Quantum Lab. However, I don't know why I see the following repeated message every time when I execute a quantum circuit: This message shows thousands ...
1
vote
1answer
35 views

How can I adjust calibration figure size?

I'm hoping to obtain a larger picture of the calibration figure. The original command is meas_fitter.plot_calibration() I tried to use ...
2
votes
2answers
115 views

Qiskit order of multiplication and tensor product

Section 2.3 of the Qiskit textbook shows us that $$ CNOT|0+\rangle \ = \ \frac{1}{\sqrt2}(|00\rangle + |11\rangle)$$ which I was able to translate to a circuit as such: ...
2
votes
1answer
51 views

Get the gates after fusion optimization in Qiskit statevector simulator

I tried to obtain the gates after fusion in Qiskit-aer statevector simulator. What I can find now is that it provides a backend option saying fusion_verbose (bool): Output gates generated in fusion ...
4
votes
2answers
86 views

Preparing Bell state $(1/\sqrt{2}) (|01\rangle + |10\rangle)$ in Qiskit

I'm working through the Qiskit textbook right now, and wanted to complete part 1 of exercise 3.4, which asks me to use qiskit to produce the Bell state: $$\frac{|01\rangle + |10\rangle}{\sqrt{2}}$$ ...
5
votes
1answer
65 views

Q# installation on Heroku

I'm trying to deploy a simple Quantum App written using Python on Heroku Server which is also using Microsoft's Q#, but getting the below error: ...
2
votes
3answers
80 views

error when running VQE in Qiskit

I am running the code, which gets the ground state energy with different atomic distances of LiH. However, I encountered this error. The code is as follow ...
1
vote
0answers
43 views

Why Measurement Error Mitigation does not seem to improve the result of VQE?

I try to follow https://github.com/Qiskit/qiskit-tutorials/blob/master/tutorials/algorithms/03_vqe_simulation_with_noise.ipynb to perform measurement error mitigation for calculating H2 energy with ...
3
votes
1answer
44 views

noisy circuit by openfermion

I am working on designing quantum error mitigation algorithms for simulating chemical systems. Therefore, a necessary component is to add noisy to the ideal circuit when using a quantum simulator. But ...

1 2
3
4 5
19