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
0answers
32 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
48 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.
2
votes
0answers
31 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
46 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
50 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
46 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
79 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
37 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
93 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
42 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 ...
1
vote
1answer
56 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
75 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
60 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
72 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
64 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
38 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
71 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 ...
0
votes
0answers
38 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
83 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
175 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
63 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
96 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
32 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
265 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
41 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
93 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
74 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
43 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
78 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
31 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
158 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
174 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
98 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
75 views

Why is the order reversed on measurement?

Why is the order reversed on measurement? ...
1
vote
1answer
36 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
62 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 ...
4
votes
1answer
79 views

Moments-based quantum circuit in Cirq

In Cirq, quantum circuit consists of moments, which in turn consists of operations. This is different from Qiskit/OpenQASM, which doesn’t have the concept of moments. What is the design philosophy ...
1
vote
1answer
81 views

Can't plot points on the Bloch sphere (QuTip)

I have the really odd problem when it comes to plotting Bloch spheres using QuTip. Plotting state vectors works perfectly fine e.g. ...
2
votes
1answer
47 views
0
votes
1answer
52 views

Which algorithm in quantum computing can be implemented for a HPC system?

I am new to quantum computing and I wanted to do a project for one of my classes where I study a specific algorithm from the field and then insert parallelism in it so it can be executed more ...
0
votes
1answer
59 views

How does one get the attributes of a circuit from its DAG in qiskit?

I have the following code, which runs properly. ...
-1
votes
1answer
386 views

Problem in installing Qiskit

When I try to install Qiskit using Pip install Qiskit I get the error as shown in the attached snapshot. Any help will be highly appreciated.
2
votes
2answers
58 views

Translating classical math and code, to quantum math and code

I am starting to see alot of classical quantitative problems such as linear regression being represented in quantum math, which suggests that almost anything based on frequentist statistics could be ...
2
votes
1answer
146 views

Quantum pricing of financial derivatives (call option) in Qiskit Aqua

In finance, a European call gives the buyer the right to buy some underlying asset such as a stock at some pre-determined strike price at a specific expiration date. The Black-Scholes equation is a ...
-1
votes
2answers
77 views

How do you pass input to a circuit? [closed]

I've implemented Grover's search algorithm in qiskit, and I'd like to pass in an input to run through the circuit. How is that done?
1
vote
1answer
91 views

Trying to make irreversable operation in the quantum circuit

I want to make a 2 qubit circuit such that the non-unitary program will transform the regular basis in the way that: $|0 0\rangle \to |00\rangle$ $|0 1\rangle \to |01\rangle$ $|10\rangle \to |01\...
0
votes
1answer
43 views

What is the time zone for the time returned by backend.properties()?

For example, backend.properties() returns following: ...
1
vote
1answer
137 views

Can my MatLab code be used as a good simulator of a quantum computer?

I have tried to program universal quantum computer simulator in MatLab. Please find a code here: https://www.mathworks.com/matlabcentral/fileexchange/73035-quantum-computer-simulator Can be this ...