{"action":"created","issue":{"url":"https://api.github.com/repos/Qiskit/qiskit-ignis/issues/282","repository_url":"https://api.github.com/repos/Qiskit/qiskit-ignis","labels_url":"https://api.github.com/repos/Qiskit/qiskit-ignis/issues/282/labels{/name}","comments_url":"https://api.github.com/repos/Qiskit/qiskit-ignis/issues/282/comments","events_url":"https://api.github.com/repos/Qiskit/qiskit-ignis/issues/282/events","html_url":"https://github.com/Qiskit/qiskit-ignis/issues/282","id":508567087,"node_id":"MDU6SXNzdWU1MDg1NjcwODc=","number":282,"title":"discriminator labels","user":{"login":"nkanazawa1989","id":39517270,"node_id":"MDQ6VXNlcjM5NTE3Mjcw","avatar_url":"https://avatars2.githubusercontent.com/u/39517270?v=4","gravatar_id":"","url":"https://api.github.com/users/nkanazawa1989","html_url":"https://github.com/nkanazawa1989","followers_url":"https://api.github.com/users/nkanazawa1989/followers","following_url":"https://api.github.com/users/nkanazawa1989/following{/other_user}","gists_url":"https://api.github.com/users/nkanazawa1989/gists{/gist_id}","starred_url":"https://api.github.com/users/nkanazawa1989/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nkanazawa1989/subscriptions","organizations_url":"https://api.github.com/users/nkanazawa1989/orgs","repos_url":"https://api.github.com/users/nkanazawa1989/repos","events_url":"https://api.github.com/users/nkanazawa1989/events{/privacy}","received_events_url":"https://api.github.com/users/nkanazawa1989/received_events","type":"User","site_admin":false},"labels":[{"id":1157290906,"node_id":"MDU6TGFiZWwxMTU3MjkwOTA2","url":"https://api.github.com/repos/Qiskit/qiskit-ignis/labels/enhancement","name":"enhancement","color":"a2eeef","default":true}],"state":"open","locked":false,"assignee":{"login":"eggerdj","id":38065505,"node_id":"MDQ6VXNlcjM4MDY1NTA1","avatar_url":"https://avatars0.githubusercontent.com/u/38065505?v=4","gravatar_id":"","url":"https://api.github.com/users/eggerdj","html_url":"https://github.com/eggerdj","followers_url":"https://api.github.com/users/eggerdj/followers","following_url":"https://api.github.com/users/eggerdj/following{/other_user}","gists_url":"https://api.github.com/users/eggerdj/gists{/gist_id}","starred_url":"https://api.github.com/users/eggerdj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eggerdj/subscriptions","organizations_url":"https://api.github.com/users/eggerdj/orgs","repos_url":"https://api.github.com/users/eggerdj/repos","events_url":"https://api.github.com/users/eggerdj/events{/privacy}","received_events_url":"https://api.github.com/users/eggerdj/received_events","type":"User","site_admin":false},"assignees":[{"login":"eggerdj","id":38065505,"node_id":"MDQ6VXNlcjM4MDY1NTA1","avatar_url":"https://avatars0.githubusercontent.com/u/38065505?v=4","gravatar_id":"","url":"https://api.github.com/users/eggerdj","html_url":"https://github.com/eggerdj","followers_url":"https://api.github.com/users/eggerdj/followers","following_url":"https://api.github.com/users/eggerdj/following{/other_user}","gists_url":"https://api.github.com/users/eggerdj/gists{/gist_id}","starred_url":"https://api.github.com/users/eggerdj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eggerdj/subscriptions","organizations_url":"https://api.github.com/users/eggerdj/orgs","repos_url":"https://api.github.com/users/eggerdj/repos","events_url":"https://api.github.com/users/eggerdj/events{/privacy}","received_events_url":"https://api.github.com/users/eggerdj/received_events","type":"User","site_admin":false},{"login":"nkanazawa1989","id":39517270,"node_id":"MDQ6VXNlcjM5NTE3Mjcw","avatar_url":"https://avatars2.githubusercontent.com/u/39517270?v=4","gravatar_id":"","url":"https://api.github.com/users/nkanazawa1989","html_url":"https://github.com/nkanazawa1989","followers_url":"https://api.github.com/users/nkanazawa1989/followers","following_url":"https://api.github.com/users/nkanazawa1989/following{/other_user}","gists_url":"https://api.github.com/users/nkanazawa1989/gists{/gist_id}","starred_url":"https://api.github.com/users/nkanazawa1989/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nkanazawa1989/subscriptions","organizations_url":"https://api.github.com/users/nkanazawa1989/orgs","repos_url":"https://api.github.com/users/nkanazawa1989/repos","events_url":"https://api.github.com/users/nkanazawa1989/events{/privacy}","received_events_url":"https://api.github.com/users/nkanazawa1989/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2019-10-17T15:47:45Z","updated_at":"2019-11-12T15:00:33Z","closed_at":null,"author_association":"NONE","body":"<!-- ⚠️ If you do not respect this template, your issue will be closed -->\r\n<!-- ⚠️ Make sure to browse the opened and closed issues to confirm this idea does not exist. -->\r\n\r\n### What is the expected behavior?\r\nLabels and qubit ordering are sometime confusing when we setup discriminator with multiple qubits.\r\n```python\r\niq_discriminator = LinearIQDiscriminator(result,\r\n                                         qubit_mask=qubits,\r\n                                         expected_states=['00', '01', '10', '11'])\r\n```\r\nBecause qiskit uses little endien to return measured bit string, we should create `expected_states` to fit in with this format. The ordering of `expected_state` should be the same as the order of schedules in a job. Also `qubit_mask` should be in ascending order. If we violate the rules, discriminator might output nonsensical results.\r\n\r\nI think these ordering issues should be handled behind the interface, and be connected with proper clreg-memory mapping [Qiskit/#2704](https://github.com/Qiskit/qiskit-terra/issues/2704).\r\n\r\nIn addition, labels in `int, float` format are very convenient. i.e. when calculating expected eigenvalues, labels like `1, -1` are required rather than `'0', '1'` (I'm not sure if this is possible because of the compatibility with result object)."},"comment":{"url":"https://api.github.com/repos/Qiskit/qiskit-ignis/issues/comments/552930399","html_url":"https://github.com/Qiskit/qiskit-ignis/issues/282#issuecomment-552930399","issue_url":"https://api.github.com/repos/Qiskit/qiskit-ignis/issues/282","id":552930399,"node_id":"MDEyOklzc3VlQ29tbWVudDU1MjkzMDM5OQ==","user":{"login":"eggerdj","id":38065505,"node_id":"MDQ6VXNlcjM4MDY1NTA1","avatar_url":"https://avatars0.githubusercontent.com/u/38065505?v=4","gravatar_id":"","url":"https://api.github.com/users/eggerdj","html_url":"https://github.com/eggerdj","followers_url":"https://api.github.com/users/eggerdj/followers","following_url":"https://api.github.com/users/eggerdj/following{/other_user}","gists_url":"https://api.github.com/users/eggerdj/gists{/gist_id}","starred_url":"https://api.github.com/users/eggerdj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eggerdj/subscriptions","organizations_url":"https://api.github.com/users/eggerdj/orgs","repos_url":"https://api.github.com/users/eggerdj/repos","events_url":"https://api.github.com/users/eggerdj/events{/privacy}","received_events_url":"https://api.github.com/users/eggerdj/received_events","type":"User","site_admin":false},"created_at":"2019-11-12T15:00:33Z","updated_at":"2019-11-12T15:00:33Z","author_association":"CONTRIBUTOR","body":"Just to be sure: in the discriminator the IQ data is extracted by doing\r\n```\r\niq_data = result.get_memory(schedule)\r\n```\r\nand is then repackaged into `xdata` by doing\r\n```\r\nfor shot in iq_data[:, self._qubit_mask]:\r\n    shot_i = list(np.real(shot))\r\n    shot_q = list(np.imag(shot))\r\n    xdata.append(shot_i + shot_q)\r\n```\r\nThus, I would expect that, for example, if we are discriminating qubit 0 and 1 out of three qubits (namely 0, 1, and 2), `self._qubit_mask` should be `[0, 1]` but the calibration strings will be `cal_000`, `cal_001`, `cal_010`, `cal_011`. @nkanazawa1989 and @dcmckayibm  is this the expected behavior?"}}
{"actor":{"display_login":"eggerdj"}}