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

PCVL-780 Barrier can be invisible #451

Merged
merged 7 commits into from
Aug 23, 2024

Conversation

ericbrts
Copy link
Contributor

No description provided.

@@ -98,6 +98,9 @@ def defined(self) -> bool:
def params(self):
return self._params.keys()

def param(self, param_name) -> Parameter:
Copy link
Contributor

Choose a reason for hiding this comment

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

type hinting for param_name


:param out_parameters: out dictionary, where key/value pairs are added.
:param pname: parameter name to consider, in the component definition.
e.g. fto retrieve "phi0" from PS(phi=P("phi0")), ask for pname="phi", as it's the parameter name for a PS.
Copy link
Contributor

Choose a reason for hiding this comment

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

typo, fto -> to


def definition(self):
return self.U

# noinspection PyMethodMayBeStatic
Copy link
Contributor

Choose a reason for hiding this comment

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

C'est specific pycharm ça non ? 👀

Copy link
Contributor Author

Choose a reason for hiding this comment

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

En effet, j'avais pas remarqué. Mais ce ne sont pas les premiers "noinspection" du code

@@ -128,7 +128,10 @@ def _expand_td(self, component_list: List):
can_output_circuit = False

else: # case time delay
t = int(c.get_variables()["t"])
t = float(c.param("t"))
if abs(t - int(t)) > 1e-6:
Copy link
Contributor

Choose a reason for hiding this comment

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

if not t.is_integer() ?

@@ -40,6 +40,19 @@
mzi_generator_func = catalog['mzi phase last'].generate


# noinspection PyTypeChecker
Copy link
Contributor

Choose a reason for hiding this comment

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

😬

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just moved this code. This "noinspection" mark was moved with it. I've just deleted it and it adds no warning. It seems it was useless.

def describe(self, _=None):
return f"Barrier({self.num_modes})"
@property
def visible(self):
Copy link
Contributor

@MarionQuandela MarionQuandela Aug 23, 2024

Choose a reason for hiding this comment

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

Maybe add a setter also to allow the user to have invisible barriers ?

    @visible.setter
    def visible(self, value: bool):
        self._visible = value

Copy link
Contributor Author

Choose a reason for hiding this comment

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

visible is already a parameter of Barrier.__init__

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes but when you create a barrier with the operator @ you don't have the possibility to make it invisible

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You don't have to use @ operator. It's only a facilitator for a very very specific case

@ericbrts ericbrts merged commit 4d6536d into Quandela:release/0.12.0 Aug 23, 2024
3 of 4 checks passed
@ericbrts ericbrts deleted the PCVL-780-barrier-0-width branch August 23, 2024 15:36
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