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

chore: update devenv and hugr #230

Merged
merged 3 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ license-file = "LICENCE"
[workspace.dependencies]

tket2 = { path = "./tket2" }
quantinuum-hugr = { git = "https://github.com/CQCL-DEV/hugr", rev = "b71cae6" }
quantinuum-hugr = { git = "https://github.com/CQCL-DEV/hugr", rev = "d0499ad" }
portgraph = { version = "0.10" }
pyo3 = { version = "0.20" }
itertools = { version = "0.11.0" }
Expand Down
30 changes: 15 additions & 15 deletions devenv.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"devenv": {
"locked": {
"dir": "src/modules",
"lastModified": 1697058441,
"narHash": "sha256-gjtW+nkM9suMsjyid63HPmt6WZQEvuVqA5cOAf4lLM0=",
"lastModified": 1699492209,
"narHash": "sha256-AhaFZrKIpU6GYUaA26erOQg2X+YHHzJpJ8r1mBHOaM8=",
"owner": "cachix",
"repo": "devenv",
"rev": "55294461a62d90c8626feca22f52b0d3d0e18e39",
"rev": "80e740c7eb91b3d1c82013ec0ba4bfbc9a83734a",
"type": "github"
},
"original": {
Expand All @@ -25,11 +25,11 @@
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
"lastModified": 1697610178,
"narHash": "sha256-1wdFrJU3ga81CbAWqx4Ix4GyXN8iC3tZg3BPI3R17ks=",
"lastModified": 1699510895,
"narHash": "sha256-eaOkJUvHeYNW/xEoRotz0rHkKihKoQdWB1ctX4q1MTQ=",
"owner": "nix-community",
"repo": "fenix",
"rev": "6de79c0b8dfb584d5423bec1612fcc357b32f60f",
"rev": "8eeef23f2c8d092227af40eff98afe5b41891e3b",
"type": "github"
},
"original": {
Expand Down Expand Up @@ -95,11 +95,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1697379843,
"narHash": "sha256-RcnGuJgC2K/UpTy+d32piEoBXq2M+nVFzM3ah/ZdJzg=",
"lastModified": 1699343069,
"narHash": "sha256-s7BBhyLA6MI6FuJgs4F/SgpntHBzz40/qV0xLPW6A1Q=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "12bdeb01ff9e2d3917e6a44037ed7df6e6c3df9d",
"rev": "ec750fd01963ab6b20ee1f0cb488754e8036d89d",
"type": "github"
},
"original": {
Expand Down Expand Up @@ -136,11 +136,11 @@
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1696846637,
"narHash": "sha256-0hv4kbXxci2+pxhuXlVgftj/Jq79VSmtAyvfabCCtYk=",
"lastModified": 1699271226,
"narHash": "sha256-8Jt1KW3xTjolD6c6OjJm9USx/jmL+VVmbooADCkdDfU=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "42e1b6095ef80a51f79595d9951eb38e91c4e6ca",
"rev": "ea758da1a6dcde6dc36db348ed690d09b9864128",
"type": "github"
},
"original": {
Expand All @@ -160,11 +160,11 @@
"rust-analyzer-src": {
"flake": false,
"locked": {
"lastModified": 1697480602,
"narHash": "sha256-XiBylVAQRwulBD0pEbct9ir+dLEAe8j3oJyrNnmRL3w=",
"lastModified": 1699451299,
"narHash": "sha256-7HJMyp62fCS6/aCCCASz8MdJM2/M8d1pBNukyLmPdwA=",
"owner": "rust-lang",
"repo": "rust-analyzer",
"rev": "d6afb4fa239fe7b5b34e5cefa9e58148fdff65b8",
"rev": "7059ae2fc2d55fa20d7e2671597b516431129445",
"type": "github"
},
"original": {
Expand Down
9 changes: 6 additions & 3 deletions devenv.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,23 @@
enterShell = ''
hello
cargo --version
python --version
poetry --version
'';

# https://devenv.sh/languages/

languages.rust = {
enable = true;
channel = "stable";
components = [ "rustc" "cargo" "clippy" "rustfmt" "rust-analyzer" ];
};

languages.python = {
enable = true;

venv.enable = true;
venv.requirements = "-r ${config.env.DEVENV_ROOT}/tket2-py/dev-requirements.txt";
poetry = {
enable = true;
};
};

# https://devenv.sh/pre-commit-hooks/
Expand Down
6 changes: 3 additions & 3 deletions tket2/src/extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub const JSON_PAYLOAD_NAME: SmolStr = SmolStr::new_inline("TKET1 Json Payload")
lazy_static! {
/// A custom type for the encoded TKET1 operation
static ref TKET1_OP_PAYLOAD : CustomType =
TKET1_EXTENSION.get_type(&JSON_PAYLOAD_NAME).unwrap().instantiate_concrete([]).unwrap();
TKET1_EXTENSION.get_type(&JSON_PAYLOAD_NAME).unwrap().instantiate([]).unwrap();

/// The TKET1 extension, containing the opaque TKET1 operations.
pub static ref TKET1_EXTENSION: Extension = {
Expand All @@ -42,7 +42,7 @@ pub static ref TKET1_EXTENSION: Extension = {
res.add_type(LINEAR_BIT_NAME, vec![], "A linear bit.".into(), TypeBound::Any.into()).unwrap();

let json_op_payload_def = res.add_type(JSON_PAYLOAD_NAME, vec![], "Opaque TKET1 operation metadata.".into(), TypeBound::Eq.into()).unwrap();
let json_op_payload = TypeParam::Opaque(json_op_payload_def.instantiate_concrete([]).unwrap());
let json_op_payload = TypeParam::Opaque(json_op_payload_def.instantiate([]).unwrap());
res.add_op_custom_sig(
JSON_OP_NAME,
"An opaque TKET1 operation.".into(),
Expand All @@ -60,7 +60,7 @@ pub static ref LINEAR_BIT: Type = {
Type::new_extension(TKET1_EXTENSION
.get_type(&LINEAR_BIT_NAME)
.unwrap()
.instantiate_concrete([])
.instantiate([])
.unwrap())
};

Expand Down
4 changes: 2 additions & 2 deletions tket2/src/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ const SYM_OP_ID: SmolStr = SmolStr::new_inline("symbolic_float");
lazy_static! {
/// The type of the symbolic expression opaque type arg.
pub static ref SYM_EXPR_T: CustomType =
EXTENSION.get_type(&SYM_EXPR_NAME).unwrap().instantiate_concrete([]).unwrap();
EXTENSION.get_type(&SYM_EXPR_NAME).unwrap().instantiate([]).unwrap();

pub static ref EXTENSION: Extension = {
let mut e = Extension::new(EXTENSION_ID);
Expand All @@ -277,7 +277,7 @@ pub static ref EXTENSION: Extension = {
TypeBound::Eq.into(),
)
.unwrap();
let sym_expr_param = TypeParam::Opaque(sym_expr_opdef.instantiate_concrete([]).unwrap());
let sym_expr_param = TypeParam::Opaque(sym_expr_opdef.instantiate([]).unwrap());

e.add_op_custom_sig_simple(
SYM_OP_ID,
Expand Down