Questions tagged [programming]

For questions relating to the process of assembling quantum programs that can be executed on a quantum computer. For questions using or about a specific programming language, consider using a more specific tag

Filter by
Sorted by
Tagged with
1
vote
1answer
23 views

IBMQ: `from qiskit import QISKitError` gives 'cannot import name QISKitError'

When I run: from qiskit import QISKitError I get the error: ImportError: cannot import name 'QISKitError' I need ...
2
votes
1answer
162 views

How to make circuit for randomly selected gate?

I am trying to make a circuit for the randomly selected gates from a gate_list but I don't know how to put these selected gates in front of ...
1
vote
0answers
32 views

Implementing QFT

I would like to know if there is a way to: Implement Quantum 'Functions' e.g the QFT of QFT* containing several single-qubit operations? Implement such operations on an arbitrary number of qubits and ...
1
vote
1answer
31 views

What are the different ways of representing unitary gates in terms of the matrix?

What are the different ways of representing unitary gates in terms of the matrix? In other words what would be the two different matrices which on multiplication give you unitary gate matrix?
0
votes
1answer
28 views

How to retrieve the parameters of a Q# operation?

I have a program that detects the methods and their corresponding parameters types of the classes in a namespace. Following is the C# class I have written: ...
2
votes
0answers
47 views

How to decompose arbitrary gates in Qiskit?

I have been exploring quantum computing, I have no idea of decomposing arbitrary gates in Qiskit. Can someone help me with an example?
1
vote
0answers
85 views

Decomposition of an arbitrary gate using given matrix in Qiskit

If I have an arbitrary non-unitary matrix of say $$ U = \begin{pmatrix} 1.5 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1.6 \\ 0 & 0 & 1 & 0 \\ 0 & 1 & 0 & 0 \\ \end{...
0
votes
1answer
65 views

Installing qiskit with `pip install qiskit` gives `ERROR: Command errored out with exit status 1`

I have created a virtual environment by virtualenv (not conda) and tried to install qiskit by: ...
2
votes
1answer
35 views

How to encode eigenvalues of matrix $A$ in solving $A\vec{x} = \vec{b}$ using the HHL Algorithm

I am trying to implement multiple parallel subroutines of HHL algorithm, each working on a different set of matrix $A$ (when solving for $x$, in $A\vec{x} = \vec{b}$), to find the expectation values ...
9
votes
2answers
2k views

Does quantum computing already possess the level of abstraction to be explicable even without knowledge of physics?

Currently, quantum computer science (in contrast to classical computer science) can mostly only be understood if one has a good inside knowledge of physics, or more precisely quantum physics. Only ...
1
vote
1answer
31 views

Strange Behaviour of MeSolve, McSolve

I'm using Qutip to plot some basic two level dynamics using hamiltonians with a temporal envelope defined as the sum of two error functions, designed to make it more representative of experimental ...
0
votes
2answers
97 views

'IBMQFactory' object has no attribute 'load_accounts'

I am following this qiskit workshop from https://colab.research.google.com/github/mtreinish/qiskit-workshop/blob/master/Workshop.ipynb . After adding my API key I had encountered the error ...
1
vote
0answers
38 views

Can two intrinsic angular momentum directions (spin) be used for future entanglement after collapse? [closed]

Persuant to all contributors, here I will use a coin toss analogy since the vector direction is either up or down (heads or tails). Two coins will be used for each of two tosses. It's assumed that the ...
1
vote
0answers
64 views

IBM qiskit vs Microsoft QDK [closed]

I am new to both IBM Qiskit and Microsoft QDK. I wish to understand which framework would be best suited for someone new to this field. I am lookig for the pros and cons of both frameworks.
3
votes
0answers
37 views

Does anyone have any really good quantum computing illustration packages or frameworks for visually teaching various aspects of QC?

I'm focusing on training non quantum physics / non math majors - software engineers to be specific (and the interested senior executive that wonders by) and am bewildered by the lack of adequate ...
0
votes
0answers
51 views

Q# code for making any two qubits entangled

Suppose there are two different qubits and both with different superposition states. What is the Q# code for making these two qubits entangled?
4
votes
1answer
54 views

Logical Explanation behind second reflection in Grover's algorithm

Logically, what does the second reflection in Grover's algorithm do? I currently don't have a lot of background in linear algebra so I'm failing to understand what exactly its purpose is and what it ...
0
votes
0answers
48 views

How to reduce the length of Q# programs execution time?

In the released Q# documentation by Microsoft available at: Quantum Development Kit Full State Simulator, it is written By default OpenMP uses all available hardware threads, which means that ...
2
votes
2answers
87 views

Is it possible to create a Q# operation with optional parameters?

In C# it is possible to have: public void Fun (int n = 0){ // ... } then the following method call examples will be compiled: ...
1
vote
1answer
46 views

OPENQASM: How to include my own libraries

I studied the OPENQASM 2.0 spec a few times but failed to find a way to include my own libraries. Have I missed anything? Right now, the only way is to use ...
3
votes
1answer
98 views

How to invoke a C# method inside a Q# operation?

Suppose there is a Q# operation as follows: operation Op () : Bool { let result = CSharpMethod (); return result } where ...
1
vote
1answer
46 views

IBM Quantum Experience API Without QISKit

I am a computer science master's student who is doing research in the field of quantum computing. I have an IBM quantum experience account(https://quantum-computing.ibm.com/) and as such I was ...
2
votes
1answer
73 views

Monty Hall Problem in Quantum Computing

Is it possible to make a quantum Monty Hall problem where the quantum computer wins the game always?
2
votes
2answers
81 views

Are there any testing framework for quantum programs?

Has any testing framework been introduced to verify and also validate the quantum programs? I know Q# supports creating unit tests for quantum programs (within xUnit framework) but I do not know about ...
1
vote
1answer
65 views

Computing circuit depth in Cirq

I ran into a problem of how to extract circuit depth from Cirq circuit object. In Cirq circuits consist of a list of Moments. Number of moments is not equal to the circuit depth in general case. I ...
4
votes
1answer
77 views

What is the corresponding code for finding the state of a qubit on the Bloch sphere?

To find the state of a qubit on the Bloch sphere we use the following formula: \begin{equation} |\psi\rangle=\mathrm{cos}\frac{\theta}{2}|0\rangle+\mathrm{e}^{i\phi}\mathrm{sin}\frac{\theta}{2}|1\...
2
votes
1answer
66 views

Is it possible to write a Q# teleportation code which returns a qubit?

In the teleportation codes I have found so far from Microsoft, the codes are written based on returning the bool values but I wonder if in teleportation process, ...
1
vote
1answer
46 views

AttributeError: 'Result' object has no attribute 'get_data'

Below is the code that I am trying to execute on Google Colab using Qiskit. I'll also paste the error that I am getting. Code ...
2
votes
1answer
88 views

Custom gates on IBM Q

I realized that QASM supports custom gates. However, when I tried to create the gate, transpiling error appeared both on simulator and real quantum processor. I suspect that IBM has not implemented ...
1
vote
0answers
45 views

A question about qiskit's WeightedPauliOperator.evolve method for IPEA (IQPE) implementation

I'm doing an implementation/tutorial of the iterative phase estimation algorithm (IPEA) and have a problem. My Hamiltonian is a diagonal matrix $H = \begin{pmatrix} E_1 & 0 \\ 0 & E_2\end{...
2
votes
1answer
84 views

Why is there only one line for the classical register?

So I am wondering why this "Quantum Teleportation Algorithm" from Qiskit - Programming on Quantum Computers Ep 5 is represented differently when I draw it (on the left in the image above) compared to ...
2
votes
1answer
212 views

How is a quantum computer programmed?

After lightly reading into quantum algorithms and the hardware of quantum computers, I subsequently started wondering how a quantum computer is programmed so it executes the desired quantum algorithm ...
0
votes
1answer
64 views

What can be done so far with cloud quantum computing?

As a developer myself, I still do not understand what can be done so far with services like AWS BRAKET or IBM CLOUD QUANTUM COMPUTING. Can someone explain me the practical purpose of it in the present?...
2
votes
1answer
121 views

How to specify the CNOT gate direction (control qubit to target qubit) in Qiskit?

If I act a CNOT gate on quantum circuit: from qiskit import QuantumCircuit qc = QuantumCircuit(2, 2) qc.cx(0, 1) it means that qubit_0 is the control qubit, and ...
3
votes
0answers
35 views

How does batching work in the optimizer loop of the VQC algorithm in Qiskit Aqua?

I've playing around with a binary classification problem with a dataset of size 1000 examples and 5 features. I'm using the VQC algorithm from the Qiskit package the that uses a feature map and a ...
1
vote
0answers
54 views

Ripple Adder using Full Adder [closed]

I have been trying to implement a ripple carry adder using qsikit in IBM Q Experience. I was able to implement full carry adder but I am having trouble with ripple carry adder. I am able to add 100 + ...
1
vote
1answer
56 views

How to create a q# operation to generate a random number from 1 to max?

I have the following problem: I want to create a q# operation for generating a random integer from 1 to max and return the generated number. What algorithm do I need? What does the q# code look like? ...
5
votes
1answer
287 views

Understanding quantum teleportation algorithm from qiskit tutorials

I am very new to quantum computing and I have recently started to experiment with qiskit module in python, by following tutorials and implementing simple algorithms....
2
votes
0answers
50 views

Grover's search for solving TSP

Consider the modified version of the Traveling Salesman Problem where you are searching for a path of length lass than some $k$. We can solve this problem using Grover's search where we encode each ...
2
votes
1answer
121 views

Couldn't connect to IBMQ server

When I access IBM Q backend with qiskit code, an error occurs. from qiskit import IBMQ qt = 'xxxxxxxxx' IBMQ.save_account(qt) IBMQ.load_accounts() The error ...
3
votes
0answers
88 views

What is “Lindblad Superoperator” in Stochastic Master Equation

I was reading a paper titled "Using a Recurrent Neural Network to Reconstruct Quantum Dynamics of a Superconducting Qubit from Physical Observations" and was confused about a stochastic master ...
0
votes
1answer
46 views

How can I implement a kraus_error in qiskit?

I have successfully run bit_flip_error in Qiskit by function pauli_error, but I can not find how to implement a ...
2
votes
1answer
109 views

How good is basic_device_noise_model() simulating the noise in the quantum computer?

Is there any paper or article about the performance of the noise model using basic_device_noise_model()? For example, like the noise model in the code below. ...
1
vote
0answers
42 views

Exponentiating Hermitian Matrix for use in QPE/HHL

I am currently trying to understand HHL by implementing a very inefficient Qiskit simulation script that performs HHL on an arbitrary hermitian matrix $A$ and a vector $b$. Because I am currently ...
4
votes
2answers
205 views

How to draw Qiskit's HHL algorithm as a circuit?

Qiskit Aqua has a module that implements the HHL algorithm: https://qiskit.org/documentation/_modules/qiskit/aqua/algorithms/single_sample/hhl/hhl.html How does one draw the implemented circuit? * ...
4
votes
3answers
239 views

Pennylane and Qiskit for quantum machine learning

I'm interested in quantum computing, specifically in “quantum machine learning” (QML). I'm going to start my masters program in computer science and have previous experience in classical machine ...
2
votes
1answer
108 views

What concepts from classical computing are vital for quantum programmers?

Many scientific programmers get by fine without having a computer science background, i.e. they don't need to know the machinery behind the prevailing paradigm of 0's and 1's (bits), let alone basic ...
4
votes
1answer
83 views

Why is the order reversed on measurement?

Why is the order reversed on measurement? ...
1
vote
1answer
38 views

qiskit - Creating your own ExperimentResultData object

Could someone guide me on how to create my own qiskit.result.models.ExperimentResultData object? I would simply like to create an object with some self-created dict ...
-1
votes
1answer
63 views

Intro to quantum computing for programmers [duplicate]

I'm looking for an entrypoint to learning about quantum computing to which I'm exposed only by popular science articles and some qiskit materials so far. I understand that it's entirely possible that ...

1 2 3 4 5 6