This repository was archived by the owner on Jan 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 55
This repository was archived by the owner on Jan 12, 2024. It is now read-only.
qsharp.compile not returning callables in the same order #148
Copy link
Copy link
Closed
Labels
Area-PythonIssue relates to the Python client for the IQ# kernel.Issue relates to the Python client for the IQ# kernel.Kind-BugSomething isn't workingSomething isn't workingResolution-DoneIssue closed as work was successfully completed.Issue closed as work was successfully completed.
Description
Describe the bug
The compile function provided by the qsharp package seems to be alphabetizing the callables it returns, which doesn't always match the order in which they are provided in the string argument to compile.
To Reproduce
Steps to reproduce the behavior:
- Open a Python Jupyter notebook in an environment/system that has the pre-requisites for the qsharp package installed. (included my environment.yml below)
- Run the following code in the first cell:
import qsharp
[zaz, alpha, foo] = qsharp.compile(
"""
operation Zaz() : Unit {
Message("Zaz");
}
operation Alpha() : Unit {
Message("Alpha");
}
operation Foo() : Unit {
Message("Foo");
}
"""
)- Once that has run, check to see what python has stored for the output of the compile by running the following:
[zaz, alpha, foo]What you will see is that the compile operation changed the order of the callables that it returned such that the python variable names do not match the callables they represent.
Expected behavior
I expect the callables to be returned from the compile step in the same order they were written in the code snippet argument to qsharp.compile.
System information
- OS: Windows 10
{'iqsharp': LooseVersion ('0.10.2002.2610'),
'Jupyter Core': LooseVersion ('1.2.36563.0'),
'.NET Runtime': LooseVersion ('.NETCoreApp,Version=v3.0'),
'qsharp': LooseVersion ('0.11.2004.2825')}
Additional context
The conda environment below is where I was testing this:
name: bug-report
channels:
- conda-forge
dependencies:
- notebook
- numpy
- scipy
- qutip
- matplotlib
- pip
- pip:
- qsharpMetadata
Metadata
Assignees
Labels
Area-PythonIssue relates to the Python client for the IQ# kernel.Issue relates to the Python client for the IQ# kernel.Kind-BugSomething isn't workingSomething isn't workingResolution-DoneIssue closed as work was successfully completed.Issue closed as work was successfully completed.
