channel
shape conventions for quantum channels
- Kraus operator 
(rank, dim_out, dim_in) - Choi operator 
(dim_in*dim_out, dim_in*dim_out) - Super operator 
(dim_out*dim_out, dim_in*dim_in) 
            numqi.channel.hf_dephasing_kraus_op(noise_rate)
    return kraus_op for dephasing channel
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                noise_rate
             | 
            
                  float
             | 
            
               the probability of dephasing, 0<=noise_rate<=1  | 
            required | 
Returns:
| Name | Type | Description | 
|---|---|---|
kraus_op |             
                  ndarray
             | 
            
               (2,2,2) kraus operators  | 
          
            numqi.channel.hf_depolarizing_kraus_op(noise_rate)
    return kraus_op for depolarizing channel
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                noise_rate
             | 
            
                  float
             | 
            
               the probability of depolarizing, 0<=noise_rate<=4/3  | 
            required | 
Returns:
| Name | Type | Description | 
|---|---|---|
kraus_op |             
                  ndarray
             | 
            
               (4,2,2) kraus operators  | 
          
            numqi.channel.hf_amplitude_damping_kraus_op(noise_rate)
    return kraus_op for amplitude damping channel
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                noise_rate
             | 
            
                  float
             | 
            
               the probability of damping, 0<=noise_rate<=1  | 
            required | 
Returns:
| Name | Type | Description | 
|---|---|---|
kraus_op |             
                  ndarray
             | 
            
               (2,2,2) kraus operators  | 
          
            numqi.channel.kraus_op_to_choi_op(op)
    convert kraus_op to choi_op
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                op
             | 
            
                  ndarray
             | 
            
               (rank, dim_out, dim_in)  | 
            required | 
Returns:
| Name | Type | Description | 
|---|---|---|
choi_op |             
                  ndarray
             | 
            
               (dim_indim_out, dim_indim_out), dtype=complex  | 
          
            numqi.channel.choi_op_to_kraus_op(op, dim_in, zero_eps=1e-10)
    convert choi_op to kraus_op
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                op
             | 
            
                  ndarray
             | 
            
               (dim_indim_out, dim_indim_out)  | 
            required | 
                dim_in
             | 
            
                  int
             | 
            
               input dimension  | 
            required | 
                zero_eps
             | 
            
                  float
             | 
            
               threshold for zero eigenvalues  | 
            
                  1e-10
             | 
          
Returns:
| Name | Type | Description | 
|---|---|---|
kraus_op |             
                  ndarray
             | 
            
               (rank, dim_out, dim_in)  | 
          
            numqi.channel.choi_op_to_super_op(op, dim_in)
    convert choi_op to super_op
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                op
             | 
            
                  ndarray
             | 
            
               (dim_indim_out, dim_indim_out)  | 
            required | 
                dim_in
             | 
            
                  int
             | 
            
               input dimension  | 
            required | 
Returns:
| Name | Type | Description | 
|---|---|---|
super_op |             
                  ndarray
             | 
            
               (dim_outdim_out, dim_indim_in)  | 
          
            numqi.channel.super_op_to_choi_op(op)
    convert super_op to choi_op
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                op
             | 
            
                  ndarray
             | 
            
               (dim_outdim_out, dim_indim_in)  | 
            required | 
Returns:
| Name | Type | Description | 
|---|---|---|
choi_op |             
                  ndarray
             | 
            
               (dim_indim_out, dim_indim_out)  | 
          
            numqi.channel.super_op_to_kraus_op(op, zero_eps=1e-10)
    convert super_op to kraus_op
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                op
             | 
            
                  ndarray
             | 
            
               (dim_outdim_out, dim_indim_in)  | 
            required | 
                zero_eps
             | 
            
                  float
             | 
            
               threshold for zero eigenvalues  | 
            
                  1e-10
             | 
          
Returns:
| Name | Type | Description | 
|---|---|---|
kraus_op |             
                  ndarray
             | 
            
               (rank, dim_out, dim_in)  | 
          
            numqi.channel.apply_kraus_op(op, rho)
    apply kraus_op to density matrix
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                op
             | 
            
                  ndarray
             | 
            
               (rank, dim_out, dim_in)  | 
            required | 
                rho
             | 
            
                  ndarray
             | 
            
               (dim_in, dim_in)  | 
            required | 
Returns:
| Name | Type | Description | 
|---|---|---|
ret |             
                  ndarray
             | 
            
               (dim_out, dim_out)  | 
          
            numqi.channel.apply_choi_op(op, rho)
    apply choi_op to density matrix
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                op
             | 
            
                  (ndarray, Tensor)
             | 
            
               (dim_indim_out, dim_indim_out)  | 
            required | 
                rho
             | 
            
                  (ndarray, Tensor)
             | 
            
               (dim_in, dim_in)  | 
            required | 
Returns:
| Name | Type | Description | 
|---|---|---|
ret |             
                  (ndarray, Tensor)
             | 
            
               (dim_out, dim_out)  | 
          
            numqi.channel.apply_super_op(op, rho)
    apply super_op to density matrix
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                op
             | 
            
                  ndarray
             | 
            
               (dim_outdim_out, dim_indim_in)  | 
            required | 
                rho
             | 
            
                  ndarray
             | 
            
               (dim_in, dim_in)  | 
            required | 
Returns:
| Name | Type | Description | 
|---|---|---|
ret |             
                  ndarray
             | 
            
               (dim_out, dim_out)  | 
          
            numqi.channel.hf_channel_to_kraus_op(hf0, dim_in)
    convert hf0 (linear map) to kraus_op
warning: not all linear map can be converted to kraus_op, see arxiv-link (eq16)
warning: bad performance
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                hf0
             | 
            
                  Callable
             | 
            
               function call for applying linear map  | 
            required | 
                dim_in
             | 
            
                  int
             | 
            
               input dimension  | 
            required | 
Returns:
| Name | Type | Description | 
|---|---|---|
kraus_op |             
                  ndarray
             | 
            
               (rank, dim_out, dim_in)  | 
          
            numqi.channel.hf_channel_to_choi_op(hf0, dim_in)
    convert hf0 (linear map) to choi_op
warning: bad performance
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                hf0
             | 
            
                  Callable
             | 
            
               function call for applying linear map  | 
            required | 
                dim_in
             | 
            
                  int
             | 
            
               input dimension  | 
            required | 
Returns:
| Name | Type | Description | 
|---|---|---|
choi_op |             
                  ndarray
             | 
            
               (dim_indim_out, dim_indim_out)  | 
          
            numqi.channel.ChannelCapacity1InfModel
    
              Bases: Module
Capacities of Quantum Channels and How to Find Them arxiv-link
            __init__(dim_in, num_state)
    initiate model
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                dim_in
             | 
            
                  int
             | 
            
               input dim  | 
            required | 
                num_state
             | 
            
                  int
             | 
            
               number of states  | 
            required | 
            set_channel_kraus_op(kop)
    set channel kraus op
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                kop
             | 
            
                  ndarray
             | 
            
               (rank, dim_out, dim_in)  | 
            required |