当我偶然发现时,我正在查看文档。上面写着:
1. Entangling here and there by applying a Hadamard gate and CNOT gate.
2. Sending the message using a CNOT gate and a Hadamard gate.
3. Taking a measurement of the first and second qubits, message and here.
4. Applying a NOT gate or a Z gate, depending on the result of the mea
我在玩Q#,它使用C#作为驱动程序。我想将Qubit对象传递给Q#代码,但它并不像预期的那样工作。
C#驱动程序
using Microsoft.Quantum.Simulation.Core;
using Microsoft.Quantum.Simulation.Simulators;
namespace Quantum.QSharpApplication1 {
class Driver {
static void Main(string[] args) {
using (var sim = new QuantumSimulator()) {
我有以下代码 x = [1, -4, 5, -2] # Data points
N = len(x) # Number of samples
n = np.arange(N) # Current sample
k = n.reshape((N, 1)) # Current frequency
e = np.exp(-2j * np.pi * k * n / N) # Exponential part
DFT = np.dot(e, x) 如何通过python或qiskit将这个经典傅立叶变换转换为量子版本?