NVIDIA/cuda-quantum

T1 Kraus channel failing CPTP test

Closed this issue · 0 comments

Required prerequisites

  • Consult the security policy. If reporting a security vulnerability, do not report the bug using this form. Use the process described in the policy to report the issue.
  • Make sure you've read the documentation. Your issue may be addressed there.
  • Search the issue tracker to verify that this hasn't already been reported. +1 or comment there if it has.
  • If possible, make a PR with a failing test to give us a starting point to work on!

Describe the bug

I am trying to define a T1 decay channel using cudaq.KrausChannel and the cuda-q and density-matrix-cpu simulator. After I define the Kraus operators and initialize the KrausChannel, I get the following runtime error: Provided kraus_ops are not completely positive and trace preserving.

image

Steps to reproduce the bug

import cudaq
import numpy as np

cudaq.set_target('density-matrix-cpu')

def error_prob(t):
    T1=1000 #ns
    T1_decay=1-np.exp(-t/T1)
    return T1_decay

t=10

#T1 event
kraus_0=np.array([[1.0,0.0],[0.0,np.sqrt(1-error_prob(t))]],dtype=np.complex128)
kraus_1=np.array([[0.0,np.sqrt(error_prob(t))],[0.0,0.0]],dtype=np.complex128)

t1_channel=cudaq.KrausChannel([kraus_0,kraus_1])

Expected behavior

I expect the given kraus ops to pass the CPTP test. I've manually checked sum K_dag K gives the identity out to 10 decimal places.

Is this a regression? If it is, put the last known working version (or commit) here.

Not a regression

Environment

  • CUDA Quantum version: 0.7.1
  • Python version: 3.10.12
  • C++ compiler:
  • Operating system: macos Sonoma 14.5

Suggestions

No response