2
$\begingroup$

How do you implement any $d$-dimensional qudit circuit in qiskit using qubits to simulate on an actual quantum computer?

$\endgroup$
1
  • $\begingroup$ You can get qutrits using qiskit pulse to access the $|2\rangle$ state. But I have no idea about higher $d$s. $\endgroup$
    – epelaez
    Jun 10, 2021 at 13:43

1 Answer 1

1
$\begingroup$

It seems this is available via the classes Statevector and DensityMatrix. For StateVector, the example from the documentation :

import numpy as np
from qiskit.quantum_info import Statevector

vec = np.zeros(2 * 10)
vec[0] = 1 / np.sqrt(2)
vec[-1] = 1 / np.sqrt(2)
psi = Statevector(vec, dims=(2, 10))
print(psi.to_dict())

And for DensityMatrix :

import numpy as np
from qiskit.quantum_info import DensityMatrix

mat = np.zeros((2 * 10, 2 * 10))
mat[0, 0] = 0.5
mat[-1, -1] = 0.5
rho = DensityMatrix(mat, dims=(2, 10))
print(rho.to_dict())
$\endgroup$
1
  • $\begingroup$ Hi Lena! These codes are for simulating on classical computer using Qiskit. I wanted to know how we should program to simulate on actual quantum computer. $\endgroup$
    – Ironman
    May 28, 2021 at 14:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.