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

Cyclic permutation #390

Merged
merged 5 commits into from
Jan 10, 2024
Merged

Conversation

Bchass
Copy link
Contributor

@Bchass Bchass commented Dec 22, 2023

Description

This take cares of Fixes #381. Ruff, pylint, and pytest are all passing locally.

Status

  • Ready to go

Copy link

codecov bot commented Dec 22, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (cbd1575) 97.6% compared to head (7c01165) 98.0%.
Report is 23 commits behind head on master.

❗ Current head 7c01165 differs from pull request most recent head bb7216b. Consider uploading reports for the commit bb7216b to get more accurate results

Additional details and impacted files
@@           Coverage Diff            @@
##           master    #390     +/-   ##
========================================
+ Coverage    97.6%   98.0%   +0.4%     
========================================
  Files         154     155      +1     
  Lines        3059    3060      +1     
  Branches      744     742      -2     
========================================
+ Hits         2987    3001     +14     
+ Misses         45      37      -8     
+ Partials       27      22      -5     

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

@Bchass
Copy link
Contributor Author

Bchass commented Dec 23, 2023

Realized the page for this function locally isn't populating correctly.
Screenshot 2023-12-23 at 9 37 39 AM

Everything is still passing locally, it was added to matrices.rst, and comparing my format to others it seems to line up. Unless it's a caching issue on my end, but I made sure to make html again for good measures.

Any ideas? @vprusso @purva-thakre

@purva-thakre
Copy link
Collaborator

purva-thakre commented Dec 26, 2023

image

I think this is some kind of formatting issue? The parameter type you added is not showing up properly either if I compare it to other functions in the docs.

image

@Bchass
Copy link
Contributor Author

Bchass commented Dec 27, 2023

Any tips on how I can get the first matrix tabbed over to the left more? I tried hspace and different alignment properties, but it's not working in the docstring.

    .. math::
        \\begin{matrix}
        (1 & 4 & 6 & 8 & 3 & 7)(2)(5)
        \\end{matrix}

        = \\begin{pmatrix}
        1 & 2 & 3 & 4 & 5 & 6 & 7 & 8

        4 & 2 & 7 & 6 & 5 & 8 & 1 & 3
        \\end{pmatrix}

        = \\begin{pmatrix}
        1 & 4 & 6 & 8 & 3 & 7 & 2 & 5

        4 & 6 & 8 & 3 & 7 & 1 & 2 & 5
        \\end{pmatrix}
Screenshot 2023-12-26 at 10 29 53 PM

docs/matrices.rst Outdated Show resolved Hide resolved
toqito/matrices/cyclic_permutation.py Outdated Show resolved Hide resolved
toqito/matrices/cyclic_permutation.py Outdated Show resolved Hide resolved
toqito/matrices/tests/test_cyclic_permutation.py Outdated Show resolved Hide resolved
@vprusso
Copy link
Owner

vprusso commented Dec 28, 2023

.. math::
\begin{matrix}
(1 & 4 & 6 & 8 & 3 & 7)(2)(5)
\end{matrix}

    = \\begin{pmatrix}
    1 & 2 & 3 & 4 & 5 & 6 & 7 & 8

    4 & 2 & 7 & 6 & 5 & 8 & 1 & 3
    \\end{pmatrix}

    = \\begin{pmatrix}
    1 & 4 & 6 & 8 & 3 & 7 & 2 & 5

    4 & 6 & 8 & 3 & 7 & 1 & 2 & 5
    \\end{pmatrix}

Hmm, maybe something like this?

.. math::
   \begin{align*}
   \begin{aligned}
   &\begin{matrix}
   (1 & 4 & 6 & 8 & 3 & 7)(2)(5)
   \end{matrix}\\
   &= \begin{pmatrix}
   1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 \\
   4 & 2 & 7 & 6 & 5 & 8 & 1 & 3
   \end{pmatrix}\\
   &= \begin{pmatrix}
   1 & 4 & 6 & 8 & 3 & 7 & 2 & 5 \\
   4 & 6 & 8 & 3 & 7 & 1 & 2 & 5
   \end{pmatrix}
   \end{aligned}
   \end{align*}

@Bchass
Copy link
Contributor Author

Bchass commented Dec 28, 2023

.. math::
\begin{matrix}
(1 & 4 & 6 & 8 & 3 & 7)(2)(5)
\end{matrix}

    = \\begin{pmatrix}
    1 & 2 & 3 & 4 & 5 & 6 & 7 & 8

    4 & 2 & 7 & 6 & 5 & 8 & 1 & 3
    \\end{pmatrix}

    = \\begin{pmatrix}
    1 & 4 & 6 & 8 & 3 & 7 & 2 & 5

    4 & 6 & 8 & 3 & 7 & 1 & 2 & 5
    \\end{pmatrix}

Hmm, maybe something like this?

.. math::
   \begin{align*}
   \begin{aligned}
   &\begin{matrix}
   (1 & 4 & 6 & 8 & 3 & 7)(2)(5)
   \end{matrix}\\
   &= \begin{pmatrix}
   1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 \\
   4 & 2 & 7 & 6 & 5 & 8 & 1 & 3
   \end{pmatrix}\\
   &= \begin{pmatrix}
   1 & 4 & 6 & 8 & 3 & 7 & 2 & 5 \\
   4 & 6 & 8 & 3 & 7 & 1 & 2 & 5
   \end{pmatrix}
   \end{aligned}
   \end{align*}

Thanks!

docs/articles.bib Outdated Show resolved Hide resolved
@vprusso
Copy link
Owner

vprusso commented Jan 10, 2024

I think this is good to go, but of course, let me know if I am incorrect, @Bchass.

Thank you again by the way for your contributions!

@purva-thakre
Copy link
Collaborator

I think this is good to go, but of course, let me know if I am incorrect, @Bchass.

Thank you again by the way for your contributions!

Minor comment about the example under :math: is still unresolved. https://github.com/vprusso/toqito/pull/390/files#r1437930898

Removing content from Wikipedia
@vprusso
Copy link
Owner

vprusso commented Jan 10, 2024

Going to go ahead and merge this one in. Thank you again for your contribution, @Bchass !

@vprusso vprusso merged commit c5d450d into vprusso:master Jan 10, 2024
12 of 13 checks passed
@Bchass Bchass deleted the cyclic_permutation_matrix branch January 11, 2024 01:28
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.

Cyclic permutation matrix of dimension "d"
3 participants