Skip to content

Conversation

@ytdHuang
Copy link
Member

@ytdHuang ytdHuang commented Jun 10, 2025

Checklist

Thank you for contributing to QuantumToolbox.jl! Please make sure you have finished the following tasks before opening the PR.

  • Please read Contributing to Quantum Toolbox in Julia.
  • Any code changes were done in a way that does not break public API.
  • Appropriate tests were added and tested locally by running: make test.
  • Any code changes should be julia formatted by running: make format.
  • All documents (in docs/ folder) related to code changes were updated and able to build locally by running: make docs.
  • (If necessary) the CHANGELOG.md should be updated (regarding to the code changes) and built by running: make changelog.

Request for a review after you have completed all the tasks. If you have not finished them all, you can also open a Draft Pull Request to let the others know this on-going work.

Description

As title, this PR makes the functionality Bloch sphere align more with qutip:

  • change frame_alpha default to 0.2
  • add field frame_width::Float64 = 1.0 to Bloch

Also with a few bug fix and improve the docstrings.

:solid
end
lines!(lscene, x, y, z; color = color, linewidth = 1.0, linestyle = linestyle)
lines!(lscene, x, y, z; color = color, linestyle = linestyle)
Copy link
Member Author

Choose a reason for hiding this comment

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

I remove the linewidth here so that Makie can automatically decide for us.

zs = raw_z
c = isa(colors, Vector) ? colors[1] : colors
lines!(lscene, xs, ys, zs; color = c, linewidth = 2.0, transparency = alpha < 1.0, alpha = alpha)
lines!(lscene, raw_x, raw_y, raw_z; color = c, transparency = alpha < 1.0, alpha = alpha)
Copy link
Member Author

Choose a reason for hiding this comment

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

I remove the linewidth here so that Makie can automatically decide for us.

t_range = range(0, θ, length = 100)
arc_points = [Point3f((v1 * cos(t) + cross(n, v1) * sin(t))) for t in t_range]
lines!(lscene, arc_points; color = RGBAf(0.8, 0.4, 0.1, 0.9), linewidth = 2.0, linestyle = :solid)
lines!(lscene, arc_points; color = "blue", linestyle = :solid)
Copy link
Member Author

Choose a reason for hiding this comment

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

I changed the default color of arcs to blue (align with qutip).

Also, I remove the linewidth here so that Makie can automatically decide for us.

font_color::String = "black"
font_size::Int = 20
frame_alpha::Float64 = 0.1
frame_alpha::Float64 = 0.2
Copy link
Member Author

Choose a reason for hiding this comment

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

Increase the frame_alpha to 0.2 (align with qutip)

@ytdHuang ytdHuang requested a review from albertomercurio June 10, 2025 14:28
@codecov
Copy link

codecov bot commented Jun 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.22%. Comparing base (dc4ecde) to head (174c0dd).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #489      +/-   ##
==========================================
+ Coverage   94.06%   94.22%   +0.16%     
==========================================
  Files          50       50              
  Lines        3418     3412       -6     
==========================================
  Hits         3215     3215              
+ Misses        203      197       -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@albertomercurio albertomercurio merged commit a4620a9 into qutip:main Jun 11, 2025
17 of 18 checks passed
@ytdHuang ytdHuang deleted the bloch-style branch June 12, 2025 00:47
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