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
0answers
15 views

How to choose $\beta$ in Gaussian derivative component of DRAG pulse?

From definition of the DRAG pulse it is: $$f(x)=Gaussian+1j*\beta*(-(x-duration/2)/\sigma^2)Gaussian,$$ where $Gaussian(x, amp, \sigma)=amp*e^{-(1/2)*(x-duration/2)^2/\sigma^2}$. If I try it in ...
0
votes
0answers
13 views

How to train a Quantum Neural network for regression model in supervised learning

We want to train a parameterised circuit(which is our neural network - from this paper. Now our final circuit looks a little like Let's say there are n training cases. So I have n |gt> vectors ...
0
votes
0answers
22 views

Questions about OpenFermion

I have some questions about OpenFermion. I'm exploring the code, does anybody knows how to implement triatomic molecules like Li-H2? How should I set the number of orbitals? Last but not least, once ...
1
vote
2answers
40 views

Are we using the real-time error information in simulating noise on qasm?

I'm trying to run some quantum circuits on qasm simulator using the noise information from IBM Q quantum device: ...
1
vote
1answer
38 views

How to set hyper parameters for a Variational Quantum Classifier (qiskit)?

I am trying to implement a Variational Quantum Classifier using qiskit's VQC. I have set the feature map to ZZFeatureMap and am using the ...
0
votes
0answers
29 views

Two body integral calculation taking too long

I'm running the most recent version of qiskit and am trying to run H2 in the cc-pvtz basis. However, it is taking an incredibly long time. This is what my code looks like: ...
2
votes
1answer
58 views

Computing expectation value of a Pauli string on stabilizer states

I need some help on stim, where I'm trying to compute expectation values of Pauli strings. Hopefully I did not overlook on the documentation an implementation of ...
0
votes
2answers
62 views

How to perform encoding and syndrome measurement in stim

I can generate the encoding circuit of a stabilizer code and can read it into stim. For example for the $[[5,1,3]]$ code : ...
1
vote
1answer
36 views

How to write a code to made envelope function equal to $\pi$ to result in an X gate?

$$ \hat U_d = \exp\Big( -i\underbrace{\frac{Q}{2}\int_0^T A(t^\prime)\mathop{dt^\prime}}_{\Theta(t)} \hat\sigma_x \Big) $$ This equation is a Unitary transformation applied to a qubit from time $t = 0$...
0
votes
0answers
24 views

How do you access stored Ramsey experiment frequency?

What is the stored frequency for the Ramsey experiment and how can this stored frequency be accessed? Is there a backend.get(frequency) command for this frequency?
0
votes
1answer
19 views

Q#/VS: No namespace with the name "Microsoft.Quantum.Canon" exists

I am trying to run a simple "Hello World" project in Q#, following this tutorial. I have completed the following steps (Step #s from tutorial link): Step 1: Installed the latest version of ...
1
vote
1answer
44 views

What is the syntax for general control gate in stim

For a stabilizer code with the stabilizers in canonical form, an encoding circuit has the form that's a product of hadamard gates and general control gates : $H_i C_i(U_i)$. For example for the $[[5,1,...
1
vote
0answers
44 views
+100

Working with higher energy states in Qiskit Experiments

I'm looking at the source code for the Qiskit Experiments module and see that the EFRabi class subclasses the Rabi class with the intent of calibrating rotations between the 1 and 2 states instead of ...
2
votes
1answer
61 views

How to import a generic stabilizer code in stim

I just started using stim to simulate the performance of quantum error correcting codes. I hope this is the right place to ask questions about the subject. The example code with the repetition code ...
1
vote
0answers
23 views

from hello_qiskit import run_puzzle results in error

I am working my way through the beta version of the Qiskit textbook. Everything was going fine until I got to the Visualizing Entanglement section and had some exercises to complete. All of the ...
2
votes
1answer
57 views

How do I pick a random Clifford operation in Stim?

I want to sample random n-qubit Clifford operations. How do I do that in Stim? (Self-answering because this was requested when the feature already existed)
3
votes
1answer
39 views

Where does the "correction" in quantum error correction occur, specifically when using repetition codes?

I'm reading the part of the qiskit textbook that deals with this (https://qiskit.org/textbook/ch-quantum-hardware/error-correction-repetition-code.html) and so far it seems as though they're just ...
1
vote
1answer
124 views

Getting non-Clifford after performing several Clifford gates in qiskit

I'm trying to test Clifford gates in qiskit according to the table in Fault-tolerant SQ, page 101. I tried 4 Cliffords in the test $$-X/2 - X -X/2,Y/2,X/2 - -X/2,Y/2,-X/2$$ using the following code <...
0
votes
1answer
51 views

How to create a quantum circuit to implement the same operations but acting on different qubits?

I want the draw the quantum circuit of the following Hamiltonian: $$H = - 4 \times X\otimes X\otimes X\otimes X - 4\times Z\otimes Z\otimes Z \otimes Z$$. I have been able to draw the circuits of $ - ...
0
votes
0answers
24 views

How can extract reduced dynamics of a bipartite system from unitary evolution in quite

Let us assume that I have a bipartite system $A\otimes B$ and an initial product state undergoing some evolution $H^{AB} = H^A+H^B+V^{AB}$, which is time independent. I want to simulate the reduced ...
0
votes
1answer
37 views

Equivalent matrix for operators in qiskit

What is eqivalent matrix to qc.rx(np.pi, 0): ...
0
votes
3answers
76 views

Which quantum computing frame is suitable for optimization problems?

As in the computer world, not all programming languages are suitable for everything. Php = Backend Javascript = Frontend Data Analsys/ML = Python embedded systems = C Mobilphone/apps = Android / Swift ...
1
vote
1answer
62 views

Is it possible to perform $z$ rotation in Qiskit with just $x$ and $y$ rotations?

Is it possible to perform $z$ rotation in Qiskit with just $x$ and $y$ rotations? I tried the following: ...
1
vote
1answer
22 views

Qiskit noise model question (from textbook)

I'm reading the chapter Introduction to Quantum Error Correction using Repetition Codes and a code example demonstrates how to add depolarizing and pauli error. I have several questions. Is it not ...
0
votes
0answers
37 views

How's the depolarization channel applied to one qubit circuits?

Suppose that in all gates used in a one qubit circuit the depolarization channel is applied, i.e. ...
-1
votes
0answers
24 views

Papers explaining how to use ShiftPhase(theta) instruction in Qiskit

When dealing with the energy states, if we apply a rotation in 0-1 space it will affect the space of 1-2 and contrary. However, I am lacking documents about this phase change between these spaces and ...
0
votes
0answers
66 views

The difference between the unitary matrix in ProjectQ and Qiskit

Why are not the same unitary matrices in ProjectQ and Qiskit in the following codes: ProjectQ: ...
2
votes
1answer
31 views

How to solve non-"cross-damping off" Linblad equation in QuTiP?

As I understand from the official QuTiP guidlines, it is only capable of solving "cross-damping off" Master Equation in form: $\dot{\rho(t)} = -\dfrac{i}{\hbar}[H(t),\rho(t)] + \sum\limits_n\...
3
votes
1answer
86 views

Implement the classical shadow coding error?

I'm trying to reproduce the basic method of classical shadow, which is based on the tutorial of pennylane. However, I've met some realization problems here when I finish reading the tutorial of ...
1
vote
1answer
42 views

Decomposition of the multi-controlled gate in tensorflow quantum

In TensorFlow Quantum 0.5.0, the support for Cirq gates that have arbitrary control via the gate.controlled_by function is added. I would like to know which kind of ...
0
votes
0answers
26 views

How to run Qiskit's transpile in parallel in Windows?

I want to execute qiskit transpile function in parallel. My experiment environment OS is Windows, and the Qiskit version is 0.29.1. I already asked one question here, and I also changed the file ...
0
votes
1answer
55 views

Expected outcome of adding two PauliOp

first of all, I would probably report this as a bug if I was confident enough in my QC abilities. As it stands, I've just started out, so I'm phrasing it as a question. From what I can tell, adding ...
0
votes
0answers
16 views

Exacting specific results in running a list of tomography circuit

I run a test on tomography of two circuits like this: ...
0
votes
1answer
66 views

Does Qiskit transpiler execute multiple circuits in parallel? [closed]

I have something to ask about Qiskit's transpiler. Before that, please check this document. ...
5
votes
1answer
65 views

Enforcing a particular layout mapping in Qiskit

I would like to ask how to set a particular layout during transpiling. I guess that the layout can be set by the initial_layout parameter in the transpiler. However,...
0
votes
2answers
49 views

qiskit transpile initial_layout determination

So, I am fairly new to Qiskit, and I've been following Qiskit textbook recently. In the chapter 7, where the QC lab exercises are located, in the first lab when working on the real hardware it is ...
3
votes
1answer
101 views

Qiskit's QFT not returning the expected state

I'm currently going through the lab problems for the Qiskit course here. I'm trying to finish lab set number 3 on QPE but I can't seem to get the desired output, even from the solution notebook. I'm ...
0
votes
1answer
69 views

Error when running a VQE circuit in IBMQ backends

I want to run a VQE circuit of 4 qubits for a simple Hamiltonian with Qiskit. The circuit run smoothly in simulators. However, when I try to implement it on real IBM' quantum computers it gives me the ...
1
vote
0answers
35 views

Callback in VQC does not return correct float value for objective function evaluation

The callback for the VQC class is defined as: callback (Optional[Callable[[ndarray, float], None]]) – a reference to a user’s callback function that has two ...
3
votes
1answer
68 views

How is quantum transpilation scaled?

While thinking about a quantum transpiler's working I had a pretty basic doubt. Say that we are trying to transpile an $n$ qubit circuit where $n > 100$. What transpiler does is that it first tries ...
1
vote
1answer
37 views

Can I use `job_manager` to get memories for 3 parts of the experiment?

Here's part of the code I'm working on: ...
1
vote
0answers
25 views

What is the input for the interpret of Quantum Variational Regressors?

I'm trying to implement my first variational regressor using qiskit. I would like to understand how the interpret of a CircuitQNN works. I need to define an interpret that works on the amplitudes of a ...
1
vote
1answer
59 views

Qiskit: How did they use Haar measure in random_statevector?

I have read this article to understand sampling state vectors from Haar measure: Understanding the Haar Measure. Qiskit uses Haar measure to sample state vectors, but when I looked at the source code ...
2
votes
1answer
78 views

What is difference between qasm_simulator and ibmq_qasm_simulator?

There are many ways how to simulate a quantum circuit on IBM Q. However, in partiuclar I am interested in a difference between qasm_simulator and ...
1
vote
0answers
22 views

Generate certain depth Clifford random circuit by qiskit

To obtain knowledge about the pattern of errors occur in quantum circuits, random Clifford circuits are a good paradigm to use in that these kind of circuits can be efficiently simulated by a ...
1
vote
1answer
48 views

Passing arrays to operations/functions in Q# Jupyter Notebooks

In order to pass inputs to Q# operations/functions with Jupyter Notebooks, one uses the magic command, %simulate, and writes out the inputs as key-value pairs, <...
0
votes
0answers
16 views

What is an example of numbers that when used for a Gaussian pulse, would result in a rotation about the x axis?

For the playing of a Gaussian pulse, what is an example of numbers that could be plugged in for duration, amp, and sigma that would result in the pulse rotating something about the x axis? Here is the ...
1
vote
1answer
51 views

Get the probability amplitudes of the 0 and 1 states of a single qubit in Qiskit considering a system of multiple qubits

I am looking for a method to get the values of $\alpha$ and $\beta$ probability amplitudes of each single qubit in a multiple qubit system. Is that possible? As you can see in the image, I have a 4-...
1
vote
1answer
99 views

Return only the measurements of a circuit

I have written the following program in jupyter: ...
2
votes
0answers
42 views

Does anyone know how to use TF Quantum with real hardware data?

I'm currently trying to embed a tensorflow model for denoising measurements as a tensorflow quantum model, and at some point I'd like for this to be able to run on hardware. After reading through all ...

1
2 3 4 5
23