Working with netrosophic sets
Project description
Neutrosophic Calculator
A Python library for performing operations on neutrosophic sets. This library supports basic arithmetic and algebraic operations, scalar multiplication, and logical operations on neutrosophic sets.
Installation
pip install neutrosophics
# netrosophic
Usage Instructions
Creating Neutrosophic Sets
You can create a neutrosophic set using truth, indeterminacy, and falsity values.
from netrosophic import NetrosophicSet
# Create a neutrosophic set
ns = NetrosophicSet(0.5, 0.3, 0.2)
print("Neutrosophic Set:", ns)
Arithmetic Operations on Neutrosophic Sets
You can perform basic arithmetic operations such as addition, subtraction, multiplication, and division on neutrosophic sets.
from netrosophic import NetrosophicSet
ns1 = NetrosophicSet(0.5, 0.3, 0.2)
ns2 = NetrosophicSet(0.4, 0.2, 0.1)
# Addition
result_add = ns1 + ns2
print("Addition:", result_add)
# Subtraction
result_sub = ns1 - ns2
print("Subtraction:", result_sub)
# Multiplication
result_mul = ns1 * ns2
print("Multiplication:", result_mul)
# Division by a scalar
result_div = ns1 / 0.5
print("Division:", result_div)
Scalar Multiplication
You can multiply a neutrosophic set by a scalar.
scalar = 2.0
result_scalar_mul = ns1.scalar_mul(scalar)
print("Scalar Multiplication:", result_scalar_mul)
Logical Operations
Logical operations such as conjunction, disjunction, and negation can be performed using the NetrosophicLogic class.
from netrosophic import NetrosophicLogic
logic = NetrosophicLogic()
result_conj = logic.conjunction(ns1, ns2)
print("Conjunction:", result_conj)
result_disj = logic.disjunction(ns1, ns2)
print("Disjunction:", result_disj)
result_neg = logic.negation(ns1)
print("Negation:", result_neg)
Analyzing a Neutrosophic Set
You can analyze a neutrosophic set to get a detailed breakdown of its truth, indeterminacy, falsity, and overall certainty.
from netrosophic import NetrosophicAnalyzer
analyzer = NetrosophicAnalyzer()
analysis = analyzer.analyze(ns1)
print("Analysis:\n", analysis)
Creating Neutrosophic Sets from Tuples
You can create a neutrosophic set from a tuple and also convert a neutrosophic set back to a tuple.
# Creating from tuple
ns3 = NetrosophicSet.from_tuple((0.6, 0.5, 0.4))
print("From tuple:", ns3)
# Converting to tuple
print("To tuple:", ns1.to_tuple())
Features
- Basic Arithmetic Operations: Add, subtract, multiply, and divide neutrosophic sets.
- Scalar Multiplication: Multiply a neutrosophic set by a scalar.
- Logical Operations: Perform conjunction, disjunction, and negation on neutrosophic sets.
- Analysis: Analyze a neutrosophic set to understand its components.
- Tuple Conversion: Create neutrosophic sets from tuples and convert them back to tuples.
License
This project is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file neutrosophics-0.0.3.tar.gz.
File metadata
- Download URL: neutrosophics-0.0.3.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ebbc30d9abd30782caee2981be9fd2189a4bbbb94acec89b06b6c1dfdd5fa7c
|
|
| MD5 |
d3c236dfb9043d251ced7f6e91c89036
|
|
| BLAKE2b-256 |
028ffe248234056c829e9ba6ae6b36f653322645460cf4425619b3226786c6d2
|
File details
Details for the file neutrosophics-0.0.3-py3-none-any.whl.
File metadata
- Download URL: neutrosophics-0.0.3-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6aa28f53df6118b3d6b813495de3ccad60b636566eeb91651b499f0bfd4b9a90
|
|
| MD5 |
2c262e2545591f77718598eb534175e7
|
|
| BLAKE2b-256 |
48620d739bde231d0caed0e9d44cba111540a714f7000b87862f073baceb2002
|