PennyLaneAI / pennylane

PennyLane is a cross-platform Python library for quantum computing, quantum machine learning, and quantum chemistry. Train a quantum computer the same way as a neural network.
https://pennylane.ai
Apache License 2.0
2.3k stars 592 forks source link

[BUG] Confusing organization of tests for features related to `qinfo` #3580

Open astralcai opened 1 year ago

astralcai commented 1 year ago

Expected behavior

  1. Each test file should only test one feature
  2. Tests for qnode transforms should be placed in the tests/qinfo directory, and tests for measurement processes should be placed in the tests/measurements directory

Actual behavior

  1. Some test files are crowded with tests for multiple features, which makes it hard to find tests for certain features, for example, tests/math/test_entropies_math.py contains tests for purity, vn_entropy, mutual_information and relative_entropy, all in one file.
  2. Some tests are placed in the wrong file, for example, tests/measurements/test_mutual_info.py should only contain tests for the mutual info measurement, but in fact, the TestIntegration class contains test cases such as test_qnode_state that is in fact testing the qnode transform.

Additional information

No response

Source code

No response

Tracebacks

No response

System information

N/A

Existing GitHub issues

Jaybsoni commented 1 year ago

Hi @astralcai,

Thanks for brining this up! This part of the code base could definitely use some clean up. Just to clarify, there wasn't anything actually breaking because of this, correct? We will for sure address this, but I just want to make sure it gets classified correctly. It seems that the chore label might be a better fit in this case. Let me know what you think!

Thanks,

astralcai commented 1 year ago

Hi @Jaybsoni

You are right, this doesn't break anything, so technically not a bug.