microsoft / qsharp

Azure Quantum Development Kit, including the Q# programming language, resource estimator, and Quantum Katas
https://microsoft.github.io/qsharp/
MIT License
459 stars 91 forks source link

Document `LogicalCounts` #1741

Open mpharrigan opened 4 months ago

mpharrigan commented 4 months ago

Hi all! I noticed the expected keys for LogicalCounts https://github.com/microsoft/qsharp/blob/fc6ec5bccac1e74dbffe5be6d78a00394b177dd8/pip/qsharp/estimator/_estimator.py#L1026 are not actually documented https://learn.microsoft.com/en-us/python/qsharp/qsharp.estimator.logicalcounts?view=qsharp-py

It would be nice to have a reference doc that lists the expected keys (i.e. what we're expected to count).

billti commented 3 months ago

Ooops. Yeah, looks like the auto-generated Python API docs are pretty poor, and we didn't cover logical counts in our more general docs at https://learn.microsoft.com/en-us/azure/quantum/intro-to-resource-estimation.

I'll look into getting these improved. For now, hopefully the source can help. See the LogicalCounts code at https://github.com/microsoft/qsharp/blob/main/pip/qsharp/estimator/_estimator.py#L1026 and some of the tests at https://github.com/microsoft/qsharp/blob/main/pip/tests/test_re.py#L158 and let me know if you've any questions still.