Skip to content

Wigner function functionality: Fixed an error#146

Merged
diego-plan9 merged 3 commits into
Qiskit:masterfrom
markjeveritt:master
Nov 15, 2017
Merged

Wigner function functionality: Fixed an error#146
diego-plan9 merged 3 commits into
Qiskit:masterfrom
markjeveritt:master

Conversation

@markjeveritt
Copy link
Copy Markdown

Fix for an indentation error in code.

Description

As above.

Motivation and Context

@diego-plan9 @ChristopheVuillot I am very sorry but an indentation error somehow got into our code. This pull request provides a fix for it.

How Has This Been Tested?

We have downloaded the revised code to a fresh location from GitHub and testing locally.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@diego-plan9 diego-plan9 self-requested a review November 13, 2017 18:11
Copy link
Copy Markdown
Member

@diego-plan9 diego-plan9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries, @markjeveritt, glad you caught the indentation issue!

Please note that your PR was issued against a previous version of the master branch on this repository, and was showing changes not belonging to your indentation fix - when issuing a new PR, making sure that you start making your changes from a branch as close to this repository's master branch would be very welcome, as it makes comparison much easier and avoids merging conflicts (and in general makes things much smoother for both the reviewer and the contributor 😄 ).

In practice, it means that your markjeveritt:master branch has been rewritten (and as a result, you will most likely need to clone it again into your local machine for further changes) now contains only two commits compared to our QISKit:master branch:

  • 633f6d0 with your indentation fix
  • d741ec2 with a set of style changes that I added, in order to conform to the repository style guidelines

I have added some inline notes that should be addressed - most of them seem a result of the renaming of the files and the functions, or similar small issues. Could you please:

  • check the issues mentioned on the inline comments, and fix them if needed
  • test the Jupyter notebook after addressing the issues, updating your PR on the tutorial repository accordingly if needed
  • ... and finally ping us back on this PR?

Comment thread qiskit/tools/qcvv/tomography.py Outdated
Copy link
Copy Markdown
Member

@diego-plan9 diego-plan9 Nov 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you double check if the c_index variable is needed, as it seems not used anywhere in the function?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not needed - removing now

Comment thread qiskit/tools/qcvv/tomography.py Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name parameter is not used in the function - can you check if that is on purpose, and if so, just remove it from the function definition?

Comment thread qiskit/tools/visualization.py Outdated
def plot_wigner_data(wigner_data, phis=None,
thetas=None, method=None,

def plot_wigner_data(wigner_data, phis=None, thetas=None, method=None,
Copy link
Copy Markdown
Member

@diego-plan9 diego-plan9 Nov 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a similar note to a comment above, can you check if the parameter thetas is needed, as it seems to be unused?

Comment thread qiskit/tools/visualization.py Outdated
thetas=None, method=None,

def plot_wigner_data(wigner_data, phis=None, thetas=None, method=None,
text_out=None):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also document text_out in the docstring?

method = 'plaquette'

if method == 'curve':
plot_wigner_curve(wigner_data, xaxis=phis)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the next lines:

     elif method == 'state':
         wigner_function(wigner_data, text_out)

wigner_function() seems not to be a valid function name: can you double-check?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we fixed the function name

@diego-plan9 did we get everything please?

@markjeveritt
Copy link
Copy Markdown
Author

@diego-plan9

Thank you for responding to us so quickly.

Sorry about the PR being issued against a previous version of the master branch - I still am getting used to git and did not realise I had done this. Did not mean to cause extra work.

Thank you so much for the rewrite of markjeveritt:master branch - we can see it took some effort from you.

We have checked the issues mentioned on the inline comments and fixed them. In all cases tis was removing unused variables as you suggested.

We have updated and tested the Jupyter notebook. This now works agains updated libraries but note we were only able to confirm against the simulator but not the experiment as the experiments timed out.

@markjeveritt
Copy link
Copy Markdown
Author

@diego-plan9 Ok I am sorry but I am still confused by git - please can you let me know if we need to anything? I think this is the right place to ask/act but please let me know if I have got not wrong.

@diego-plan9
Copy link
Copy Markdown
Member

Thanks for the changes, Mark! They are looking on the right track at a first glance, but I have not done a full review yet - if something else is needed, we make sure to let contributors know by commenting on the PR. In general, it is not unusual that the reviews and the "overall life time" of a pull request spawns over the course of days, depending on the work load and other factors - but we will get to it eventually, no worries!

@markjeveritt
Copy link
Copy Markdown
Author

@diego-plan9 Understood. I am beginning to get git now - thanks for your patience.

c_index removed

name removed from wigner_data

thetas removed form plot_wigner_data

wigner_function replaced with plot_wigner_function

text_out removed from plot_wigner_data as not needed
@diego-plan9
Copy link
Copy Markdown
Member

It's looking good, thanks for the contribution, Mark! I'll merge this PR and we can continue discussion if needed on the PR for the tutorials - please note that PR might take longer to get merged, as some changes to that repository are in progress.

@diego-plan9 diego-plan9 merged commit b0bf868 into Qiskit:master Nov 15, 2017
taalexander pushed a commit to taalexander/qiskit-terra that referenced this pull request May 2, 2019
* Pin versions and document versioning policy

This commit pins the versions of the tracked elements to ensure that we
only ever install a single version of an element when we install the
meta-package. Additionally, to make it clear why we do this, and how we
handle versioning this also adds a doc on the procedure for handling
versioning.

Fixes Qiskit#141

* Update contributing guide to point to new docs

* Fix missing variable error

* Add versioning doc to index
lia-approves pushed a commit to edasgupta/qiskit-terra that referenced this pull request Jul 30, 2019
Wigner function functionality: Fixed an error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants