Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
pyMOR
pymor
Commits
f63e02e1
Commit
f63e02e1
authored
May 04, 2022
by
Patrick Buchfink
Browse files
Fix flake8 warnings
parent
7b435684
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/pymor/algorithms/symplectic.py
View file @
f63e02e1
...
...
@@ -69,8 +69,8 @@ class SymplecticBasis(BasicObject):
U
The |VectorArray|.
check_symplecticity
Flag, wether to check symplecticity of E and F in the constructor (if these are not
None).
Default is True.
Flag, wether to check symplecticity of E and F in the constructor (if these are not
None).
Default is True.
Returns
-------
...
...
@@ -96,7 +96,7 @@ class SymplecticBasis(BasicObject):
E
=
J
.
apply_adjoint
(
self
.
F
*
(
-
1
))
F
=
J
.
apply_adjoint
(
self
.
E
)
# check_symplecticity = False, otherwise recursion loop
return
SymplecticBasis
(
E
,
F
,
check_symplecticity
=
False
)
return
SymplecticBasis
(
E
,
F
,
check_symplecticity
=
False
)
def
to_array
(
self
):
"""Convert to |VectorArray|.
...
...
@@ -122,8 +122,8 @@ class SymplecticBasis(BasicObject):
remove_from_other
Flag, wether to remove vectors from other.
check_symplecticity
Flag, wether to check symplecticity of E and F in the constructor (if these are not
None).
Default is True.
Flag, wether to check symplecticity of E and F in the constructor (if these are not
None).
Default is True.
"""
assert
isinstance
(
other
,
SymplecticBasis
)
assert
other
.
phase_space
==
self
.
phase_space
...
...
src/pymortests/algorithms/symplectic.py
View file @
f63e02e1
...
...
@@ -11,7 +11,7 @@ from pymor.vectorarrays.numpy import NumpyVectorSpace
METHODS_DICT
=
{
'psd_cotengent_lift'
:
psd_cotengent_lift
,
'psd_complex_svd'
:
psd_complex_svd
,
'psd_svd_like_decomp'
:
psd_svd_like_decomp
,
'psd_svd_like_decomp'
:
psd_svd_like_decomp
,
}
KEYS_ORTHOSYMPL_METHOD
=
[
'psd_cotengent_lift'
,
'psd_complex_svd'
]
...
...
@@ -19,7 +19,6 @@ KEYS_ORTHOSYMPL_METHOD = ['psd_cotengent_lift', 'psd_complex_svd']
@
pytest
.
mark
.
parametrize
(
'key_basis_gen_method'
,
METHODS_DICT
.
keys
())
def
test_symplecticity
(
key_method
):
"""Check symplecticity of symplectic basis generation methods."""
half_dim
=
1000
half_space
=
NumpyVectorSpace
(
half_dim
)
phase_space
=
BlockVectorSpace
([
half_space
]
*
2
)
...
...
@@ -34,7 +33,6 @@ def test_symplecticity(key_method):
@
pytest
.
mark
.
parametrize
(
'key_orthosympl_basis_gen_method'
,
KEYS_ORTHOSYMPL_METHOD
)
def
test_orthonormality
(
key_orthosympl_method
):
"""Check orthonormality for orthosymplectic basis generation methods."""
half_dim
=
1000
half_space
=
NumpyVectorSpace
(
half_dim
)
phase_space
=
BlockVectorSpace
([
half_space
]
*
2
)
...
...
@@ -49,7 +47,6 @@ def test_orthonormality(key_orthosympl_method):
@
pytest
.
mark
.
parametrize
(
'reiterate'
,
[
False
,
True
])
def
test_symplectic_gram_schmidt
(
test_orthonormality
,
reiterate
):
"""Check symplecticity and orthonormality for symplectic_gram_schmidt."""
half_dim
=
1000
half_space
=
NumpyVectorSpace
(
half_dim
)
phase_space
=
BlockVectorSpace
([
half_space
]
*
2
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment