Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Font scaling in labels of plot.matrix2d() #129

Closed
petergthatsme opened this issue May 13, 2022 · 0 comments · Fixed by #135
Closed

Font scaling in labels of plot.matrix2d() #129

petergthatsme opened this issue May 13, 2022 · 0 comments · Fixed by #135

Comments

@petergthatsme
Copy link
Collaborator

This issue is meant as a unitaryHACK bounty issue.
Bounty: $50

Function plot.matrix2d() is used when creating matrix element plots (it is called by qubit methods <qubit>.plot_matrixelements()). It has an argument show_numbers which explicitly adds text labels to indicate matrix element sizes. This example below shows how that works:

tmon2 = scq.Transmon(
    EJ=30.02,
    EC=1.2,
    ng=0.0,
    ncut=31
)
tmon.plot_matrixelements('cos_phi_operator', evals_count=10, show3d=False, show_numbers=True);

When too many levels are included, however, these labels start overlapping with each other, as in:

tmon.plot_matrixelements('cos_phi_operator', evals_count=16, show3d=False, show_numbers=True);

We are looking for a small enhancement that adds simple logic to plot.matrix2d() which would scale the font size so that the text labels can be easily distinguished (within reason).
Ideally this modification should take into account the figure size, so that if more levels are being included, but the figure size is large enough, then the font used does not have to be extremely small.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants