cuda-quantum icon indicating copy to clipboard operation
cuda-quantum copied to clipboard

Support DepolarizingChannel for multiqubit gates

Open ikkoham opened this issue 1 year ago • 5 comments

Required prerequisites

  • [x] Search the issue tracker to check if your feature has already been mentioned or rejected in other issues.

Describe the feature

DepolarizingChannel can be defined for multiple qubits. For example, the following code should work as expected:

import cudaq
cudaq.set_target("density-matrix-cpu")

depolarization_channel = cudaq.DepolarizationChannel(probability=0.3)

noise_model = cudaq.NoiseModel()
noise_model.add_all_qubit_channel("cx", depolarization_channel)

@cudaq.kernel
def test():
    q = cudaq.qvector(2)
    x(q[0])
    cx(q[0], q[1])

print(cudaq.sample(test, noise_model=noise_model))

ikkoham avatar Feb 04 '25 04:02 ikkoham

Hi, I'm interested in working on this issue. Planning to map the current DepolarizationChannel to the individual qubits through the add_all_qubit_channel function. Please could you assign this issue to me

sefunmi4 avatar Aug 20 '25 16:08 sefunmi4

@bettinaheim @efratshabtai is it ok to assign @sefunmi4?

ikkoham avatar Sep 09 '25 01:09 ikkoham

I believe https://github.com/NVIDIA/cuda-quantum/pull/2653 may have already done this using a new Depolarization2 noise channel. There is an example about how to use it in the CUDA-QX docs. Does that meet your needs, or would you like to investigate an alternate way of doing this?

bmhowe23 avatar Sep 09 '25 14:09 bmhowe23

@bmhowe23 Thanks. I was thinking about general qubit counts, but your PR seems fine too. Ideally, I'd like to see 3-qubit support as well. Some hardware natively supports 3-qubit gates. As far as I know, 4-qubit support doesn't exist. Also, global (=all qubits in the circuits) depolarizing operations are sometimes used in theoretical research, so I'd like to see that included.

ikkoham avatar Sep 10 '25 02:09 ikkoham

Yeah, if you want to support > 1 control and 1 target, you need to currently create your own Noise Model and then pass in the number of controls like this:

noise.add_all_qubit_channel("x", NewNoiseModelDepolarization(N, p), num_controls)

This issue could indeed be used to work on that enhancement.

bmhowe23 avatar Sep 10 '25 02:09 bmhowe23