-
Notifications
You must be signed in to change notification settings - Fork 220
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
[py][nfc] import
s clean up.
#2590
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,16 +6,16 @@ | |
# the terms of the Apache License 2.0 which accompanies this distribution. # | ||
# ============================================================================ # | ||
from __future__ import annotations | ||
|
||
from ..mlir._mlir_libs._quakeDialects import cudaq_runtime | ||
from ..mlir.dialects import quake, cc | ||
from ..mlir.ir import * | ||
from ..mlir.passmanager import * | ||
import numpy as np | ||
from typing import Callable, List | ||
import ast, sys, traceback | ||
import ast | ||
import re | ||
from typing import get_origin | ||
import sys | ||
import traceback | ||
import numpy as np | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Q: Are the external imports sorted alphabetically? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was going for that but it's really an arbitrary decision. The only exception being |
||
from typing import get_origin, Callable, List | ||
|
||
from cudaq.mlir._mlir_libs._quakeDialects import cudaq_runtime | ||
from cudaq.mlir.dialects import quake, cc | ||
from cudaq.mlir.ir import ComplexType, F32Type, F64Type, IntegerType | ||
|
||
State = cudaq_runtime.State | ||
qvector = cudaq_runtime.qvector | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,10 +10,9 @@ | |
from typing import Sequence, Mapping, List, Optional | ||
|
||
from .cudm_helpers import CuDensityMatOpConversion, constructLiouvillian | ||
from ..runtime.observe import observe | ||
from .schedule import Schedule | ||
from .expressions import Operator | ||
from ..mlir._mlir_libs._quakeDialects import cudaq_runtime | ||
from cudaq.mlir._mlir_libs._quakeDialects import cudaq_runtime | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Q: Is there relative ordering for the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It should have. The idea was to have project imports followed by relative imports. Also, I did change things in a way that relative imports are only for modules within the same directory (so moving the whole directory wouldn't require changing the imports) |
||
from .cudm_helpers import cudm, CudmStateType | ||
from .cudm_state import CuDensityMatState, as_cudm_state | ||
from .helpers import InitialState, InitialStateArgT | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I think we are inconsistent with a blank line after the copyright banner and fist import.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, we don't seem to have any guideline regarding these things.