'qml.ThermalRelaxationError' argument typo

Hi. I am currently using qml.ThermalRelaxationError code to replicate the noisy circuit.
When reading the class source code, it seems like the parameter ‘tq’ is a typo, where the correct parameter name seems like ‘tg’ (float): the gate time for relaxation error.

I find it no where the ‘tq’ argument is being used in the source, code but somehow the class code works.

# Put code here
class ThermalRelaxationError(Channel):
    r"""
    Thermal relaxation error channel.
...
...
    num_params = 4
    num_wires = 1
    grad_method = "F"

    def __init__(self, pe, t1, t2, tq, wires, id=None):
        super().__init__(pe, t1, t2, tq, wires=wires, id=id)

[docs]    @staticmethod
    def compute_kraus_matrices(pe, t1, t2, tg):  # pylint:disable=arguments-differ
        """Kraus matrices representing the ThermalRelaxationError channel.

        Args:
            pe (float): exited state population. Must be between ``0`` and ``1``
            t1 (float): the :math:`T_1` relaxation constant
            t2 (float): The :math:`T_2` dephasing constant. Must be less than :math:`2 T_1`
            tg (float): the gate time for relaxation error

If not a typo, would you give me a tip about why is not an typo? If it is a typo, then I hope it could be of help to fix the minor code error. Thank you for reading this.

Hi @taehyunkim,

Welcome to the Forum!

It does look to me like a typo. It doesn’t fail because it’s set as an argument instead of a keyword argument :relieved: .

Let me check with the team if they see any concerns about making this change. I’ll get back to you soon and thanks for offering to fix it!

Hi @taehyunkim,

I can confirm that this is indeed a typo. Do you want to make the change from tq to tg in the function signature and __init__ ? Or maybe one of your students? This is can be a good first contribution to PennyLane, great to get familiarized with the process.

Here’s a blog post with some advice on contributing to quantum open source projects.

Please let me know in case you need additional guidance on this or if you prefer that someone else makes the fix.

Thanks again for making us aware of it!

1 Like

Hi @taehyunkim !

I’ve made this issue on our GitHub to track this typo. Let me know if you or one of your students want to fix it. Otherwise we’ll get someone on our team to fix it.

Hi @CatalinaAlbornoz !
It will be great if your team could fix it.
Thank you for your response, and have a good day. :slight_smile:

No problem, thanks for letting us know. Have a good day! :smile: